]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - scripts/checkpatch.pl
checkpatch: improve "no space after cast" test
[linux-imx.git] / scripts / checkpatch.pl
index c2d223c406e83202626452cf71c4e3ba8131c52a..ab39ceb3828688d993f61c2fc74f7617446b41b2 100755 (executable)
@@ -241,10 +241,11 @@ our $Float        = qr{$Float_hex|$Float_dec|$Float_int};
 our $Constant  = qr{$Float|$Binary|$Hex|$Int};
 our $Assignment        = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
 our $Compare    = qr{<=|>=|==|!=|<|>};
+our $Arithmetic = qr{\+|-|\*|\/|%};
 our $Operators = qr{
                        <=|>=|==|!=|
                        =>|->|<<|>>|<|>|!|~|
-                       &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%
+                       &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic
                  }x;
 
 our $NonptrType;
@@ -1885,7 +1886,7 @@ sub process {
                        }
                }
 
-               if ($line =~ /^\+.*\*[ \t]*\)[ \t]+/) {
+               if ($line =~ /^\+.*\*[ \t]*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
                        CHK("SPACING",
                            "No space is necessary after a cast\n" . $hereprev);
                }