History

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.

Joe Perches committed 12 years ago

Commit 447432f1 parent 6c8bd701 file · +1 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+1−1
@@ -296,7 +296,7 @@ our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; · 295 unmodified lines
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 <=|>=|==|!=|