From: Joe Perches Date: Thu, 3 Apr 2014 21:49:17 +0000 (-0700) Subject: checkpatch: fix jiffies comparison and others X-Git-Tag: accepted/tizen/common/20141203.182822~309^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=447432f32328dcd081ae5e23f27d2ffa19f2ecf8;p=platform%2Fkernel%2Flinux-arm64.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e7c50977..646295c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -296,7 +296,7 @@ our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; our $Float = qr{$Float_hex|$Float_dec|$Float_int}; our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; -our $Compare = qr{<=|>=|==|!=|<|>}; +our $Compare = qr{<=|>=|==|!=|<|(?}; our $Arithmetic = qr{\+|-|\*|\/|%}; our $Operators = qr{ <=|>=|==|!=|