X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=scripts%2Fcheckpatch.pl;h=2287a0bca863bf57ffabaae9de58aab0174826c3;hb=9c80034921d1ece5c0e3241ba1645bce32387684;hp=8f940c09918f0e6c8971535030f92fccb0f073d5;hpb=6735a1971a00a29a96aa3ea5dc08912bfee95c51;p=karo-tx-linux.git diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8f940c09918f..2287a0bca863 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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