X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=scripts%2Fcheckpatch.pl;h=0ea2a1e24ade493ed22c6b817c91a07736b11563;hb=fea8893da7c52906caa1a8dc3199f4b2ed3b8dbd;hp=1dbd6d1cd1b5f45d62a86d5faa0d8f92eb4227f4;hpb=15333539a9b3022656f815f643a77f6b054b335f;p=~andy%2Flinux diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1dbd6d1cd1b..0ea2a1e24ad 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2665,6 +2665,15 @@ sub process { $herecurr); } +# check for function declarations without arguments like "int foo()" + if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { + if (ERROR("FUNCTION_WITHOUT_ARGS", + "Bad function definition - $1() should probably be $1(void)\n" . $herecurr) && + $fix) { + $fixed[$linenr - 1] =~ s/(\b($Type)\s+($Ident))\s*\(\s*\)/$2 $3(void)/; + } + } + # check for uses of DEFINE_PCI_DEVICE_TABLE if ($line =~ /\bDEFINE_PCI_DEVICE_TABLE\s*\(\s*(\w+)\s*\)\s*=/) { if (WARN("DEFINE_PCI_DEVICE_TABLE",