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
296our $Float = qr{$Float_hex|$Float_dec|$Float_int};296our $Float = qr{$Float_hex|$Float_dec|$Float_int};
297our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int};297our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int};
298our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};298our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
299our $Compare = qr{<=|>=|==|!=|<|>};299our $Compare = qr{<=|>=|==|!=|<|(?<!-)>};
300our $Arithmetic = qr{\+|-|\*|\/|%};300our $Arithmetic = qr{\+|-|\*|\/|%};
301our $Operators = qr{301our $Operators = qr{
302 <=|>=|==|!=|302 <=|>=|==|!=|