mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 01:21:58 +00:00
checkpatch: improve CONSTANT_COMPARISON test for structure members
A "." dereference to an all uppercase structure member can be incorrectly reported as a CONSTANT_COMPARISON. ie: "if (table[i].PANELID == tempdx)" Fix it by checking for "." before the constant test. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2d6327459e
commit
f39e1769bb
1 changed files with 1 additions and 1 deletions
|
@ -4291,7 +4291,7 @@ sub process {
|
|||
my $comp = $3;
|
||||
my $to = $4;
|
||||
my $newcomp = $comp;
|
||||
if ($lead !~ /$Operators\s*$/ &&
|
||||
if ($lead !~ /(?:$Operators|\.)\s*$/ &&
|
||||
$to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ &&
|
||||
WARN("CONSTANT_COMPARISON",
|
||||
"Comparisons should place the constant on the right side of the test\n" . $herecurr) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue