Re: [PATCH 2/7] efi: Document #define FOO_PROTOCOL_GUID layout

From: Joe Perches
Date: Mon Jun 27 2016 - 07:14:37 EST


On Mon, 2016-06-27 at 12:49 +0200, Ingo Molnar wrote:
> * Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx> wrote:
[]
> > + * EFI Configuration Table and GUID definitions
> > + *
> > + * These should be formatted roughly like the ones in the UEFI SPEC has
> > + * them.  It makes them easier to grep for, and they look the same when
> > + * you're staring at them.
[]
> Btw., another possible way to organize the GUIDs would be to ignore checkpatch (we 
> should ignore checkpatch when it's wrong)

Completely agree. checkpatch is brainless.

> and go for a nice table format:
> 
> #define NULL_GUID EFI_GUID(0x00000000, 0x0000, 0x0000,  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)

Much nicer.

There are a few more files that use EFI_GUID.
It'd be good to standardize.

$ git grep --name-only -w EFI_GUID
arch/ia64/include/asm/sal.h
arch/ia64/kernel/esi.c
arch/x86/platform/efi/quirks.c
block/partitions/efi.h
drivers/infiniband/hw/hfi1/efivar.c
drivers/scsi/isci/probe_roms.h
include/linux/efi.h

Maybe a checkpatch line-length exclusion:
---
 scripts/checkpatch.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4904ced..cc787e6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2764,6 +2764,10 @@ sub process {
   $line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) {
  $msg_type = "";
 
+ # EFI_GUID is another special case
+ } elsif ($line =~ /^\+.*\bEFI_GUID\s*\(/) {
+ $msg_type = "";
+
  # Otherwise set the alternate message types
 
  # a comment starts before $max_line_length