X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=scripts%2Fcheckpatch.pl;h=8f9e394298cda6cb17edd29b5239d0a134732650;hb=fdc0ad80a4f27efcb457b49f5dd8455a3d623559;hp=58848e3e392c7c45004340d8704229da18e990eb;hpb=d3e458d78167102cc961237cfceef6fffc80c0b3;p=~andy%2Flinux diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 58848e3e392..8f9e394298c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2804,9 +2804,9 @@ sub process { WARN("consider using a completion\n" . $herecurr); } -# recommend strict_strto* over simple_strto* +# recommend kstrto* over simple_strto* if ($line =~ /\bsimple_(strto.*?)\s*\(/) { - WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); + WARN("consider using kstrto* in preference to simple_$1\n" . $herecurr); } # check for __initcall(), use device_initcall() explicitly please if ($line =~ /^.\s*__initcall\s*\(/) { @@ -2902,6 +2902,11 @@ sub process { $line =~ /DEVICE_ATTR.*S_IWUGO/ ) { WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); } + + # Check for memset with swapped arguments + if ($line =~ /memset.*\,(\ |)(0x|)0(\ |0|)\);/) { + ERROR("memset size is 3rd argument, not the second.\n" . $herecurr); + } } # If we have no input at all, then there is nothing to report on @@ -2944,6 +2949,7 @@ sub process { if ($rpt_cleaners) { print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n"; print " scripts/cleanfile\n\n"; + $rpt_cleaners = 0; } }