UPSTREAM: 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.
BUG=none
BRANCH=none
TEST=none
Change-Id: I69e9577374579bf24736b2961285938c124df8c0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 010905ed2f
Original-Change-Id: Ieb0c96027e8df842f60ca7c9de7aac941eed1dc2
Original-Signed-off-by: Martin Roth <martinroth@google.com>
Original-Reviewed-on: https://review.coreboot.org/18570
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/452366
This commit is contained in:
parent
89a3dc4f7d
commit
566f0d168e
1 changed files with 1 additions and 0 deletions
|
|
@ -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) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue