]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - scripts/checkpatch.pl
i2c: rephrase explanation of I2C_CLASS_DEPRECATED
[karo-tx-linux.git] / scripts / checkpatch.pl
index 8f940c09918f0e6c8971535030f92fccb0f073d5..2287a0bca863bf57ffabaae9de58aab0174826c3 100755 (executable)
@@ -5576,10 +5576,18 @@ sub process {
                            "architecture specific defines should be avoided\n" .  $herecurr);
                }
 
+# check that the storage class is not after a type
+               if ($line =~ /\b($Type)\s+($Storage)\b/) {
+                       WARN("STORAGE_CLASS",
+                            "storage class '$2' should be located before type '$1'\n" . $herecurr);
+               }
 # Check that the storage class is at the beginning of a declaration
-               if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
+               if ($line =~ /\b$Storage\b/ &&
+                   $line !~ /^.\s*$Storage/ &&
+                   $line =~ /^.\s*(.+?)\$Storage\s/ &&
+                   $1 !~ /[\,\)]\s*$/) {
                        WARN("STORAGE_CLASS",
-                            "storage class should be at the beginning of the declaration\n" . $herecurr)
+                            "storage class should be at the beginning of the declaration\n" . $herecurr);
                }
 
 # check the location of the inline attribute, that it is between