Elyes Haouas has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63582 )
Change subject: util/lint/checkpatch.pl: Update to v5.18-2 lines related to CONST_STRUCT ......................................................................
util/lint/checkpatch.pl: Update to v5.18-2 lines related to CONST_STRUCT
Signed-off-by: Elyes Haouas ehaouas@noos.fr Change-Id: I0fe2ec6a74a4b8c70452fbf05d534a37e1ea2c26 --- M util/lint/checkpatch.pl 1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/63582/1
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index b5184bd..3359150 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -855,9 +855,11 @@ return 0; }
-my $const_structs = ""; -read_words($const_structs, $conststructsfile) - or warn "No structs that should be const will be found - file '$conststructsfile': $!\n"; +my $const_structs; +if (show_type("CONST_STRUCT")) { + read_words($const_structs, $conststructsfile) + or warn "No structs that should be const will be found - file '$conststructsfile': $!\n"; +}
my $typeOtherTypedefs = ""; if (length($typedefsfile)) { @@ -6591,7 +6593,8 @@
# check for various structs that are normally const (ops, kgdb, device_tree) # and avoid what seem like struct definitions 'struct foo {' - if ($line !~ /\bconst\b/ && + if (defined($const_structs) && + $line !~ /\bconst\b/ && $line =~ /\bstruct\s+($const_structs)\b(?!\s*{)/) { WARN("CONST_STRUCT", "struct $1 should normally be const\n" . $herecurr);