[coreboot-gerrit] Patch set updated for coreboot: uti/lint/checkpatch: Fix __attribute__ struct errors for OPEN_BRACE

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Tue Mar 7 17:49:32 CET 2017


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18570

-gerrit

commit 1f7417b9f6c055f8e1efcb407528c2efb2965470
Author: Martin Roth <martinroth at google.com>
Date:   Sat Mar 4 19:28:37 2017 -0700

    uti/lint/checkpatch: Fix __attribute__ struct errors for OPEN_BRACE
    
    The __attribute__((weak)) lines on structs were being read as functions,
    causing a warning that the brace should be on the next line.
    Add a check to see if it's a struct with an attribute, and ignore it for
    the OPEN_BRACE check if it is.
    
    Change-Id: Ieb0c96027e8df842f60ca7c9de7aac941eed1dc2
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 util/lint/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 031aa34..9afa232 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -3736,6 +3736,7 @@ sub process {
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
 		if (($line=~/$Type\s*$Ident\(.*\).*\s*{/) and
+		    ($line!~/struct.*__attribute__\(\(.*\)\)/) and
 		    !($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
 			if (ERROR("OPEN_BRACE",
 				  "open brace '{' following function declarations go on the next line\n" . $herecurr) &&



More information about the coreboot-gerrit mailing list