diff options
author | Joe Perches <joe@perches.com> | 2014-04-03 17:49:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:21:13 -0400 |
commit | 447432f32328dcd081ae5e23f27d2ffa19f2ecf8 (patch) | |
tree | e75c405d4ebb8fb2571ec6494143f203e12ba72f /scripts | |
parent | 6c8bd7076d79687183126fa7ffaa700fc2007d81 (diff) |
checkpatch: fix jiffies comparison and others
checkpatch could not distinguish between a variable in a struct named
jiffies and the normal jiffies.
foo->jiffies
would emit a "Comparing jiffies" arning.
Update the $Compare variable to do a negative look-behind for "-" when
finding a ">" so that a pointer dereference like -> isn't a comparison.
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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e7c50977fe3d..646295cd9990 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -296,7 +296,7 @@ our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; | |||
296 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; | 296 | our $Float = qr{$Float_hex|$Float_dec|$Float_int}; |
297 | our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; | 297 | our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; |
298 | our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; | 298 | our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; |
299 | our $Compare = qr{<=|>=|==|!=|<|>}; | 299 | our $Compare = qr{<=|>=|==|!=|<|(?<!-)>}; |
300 | our $Arithmetic = qr{\+|-|\*|\/|%}; | 300 | our $Arithmetic = qr{\+|-|\*|\/|%}; |
301 | our $Operators = qr{ | 301 | our $Operators = qr{ |
302 | <=|>=|==|!=| | 302 | <=|>=|==|!=| |