Skip to content

Commit 447432f

Browse files
JoePerchestorvalds
authored andcommitted
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>
1 parent 6c8bd70 commit 447432f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/checkpatch.pl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ sub hash_show_words {
296296
our $Float = qr{$Float_hex|$Float_dec|$Float_int};
297297
our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int};
298298
our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
299-
our $Compare = qr{<=|>=|==|!=|<|>};
299+
our $Compare = qr{<=|>=|==|!=|<|(?<!-)>};
300300
our $Arithmetic = qr{\+|-|\*|\/|%};
301301
our $Operators = qr{
302302
<=|>=|==|!=|

0 commit comments

Comments
 (0)