diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 58848e3e392c..8f9e394298cd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2804,9 +2804,9 @@ sub process { | |||
2804 | WARN("consider using a completion\n" . $herecurr); | 2804 | WARN("consider using a completion\n" . $herecurr); |
2805 | 2805 | ||
2806 | } | 2806 | } |
2807 | # recommend strict_strto* over simple_strto* | 2807 | # recommend kstrto* over simple_strto* |
2808 | if ($line =~ /\bsimple_(strto.*?)\s*\(/) { | 2808 | if ($line =~ /\bsimple_(strto.*?)\s*\(/) { |
2809 | WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); | 2809 | WARN("consider using kstrto* in preference to simple_$1\n" . $herecurr); |
2810 | } | 2810 | } |
2811 | # check for __initcall(), use device_initcall() explicitly please | 2811 | # check for __initcall(), use device_initcall() explicitly please |
2812 | if ($line =~ /^.\s*__initcall\s*\(/) { | 2812 | if ($line =~ /^.\s*__initcall\s*\(/) { |
@@ -2902,6 +2902,11 @@ sub process { | |||
2902 | $line =~ /DEVICE_ATTR.*S_IWUGO/ ) { | 2902 | $line =~ /DEVICE_ATTR.*S_IWUGO/ ) { |
2903 | WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); | 2903 | WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); |
2904 | } | 2904 | } |
2905 | |||
2906 | # Check for memset with swapped arguments | ||
2907 | if ($line =~ /memset.*\,(\ |)(0x|)0(\ |0|)\);/) { | ||
2908 | ERROR("memset size is 3rd argument, not the second.\n" . $herecurr); | ||
2909 | } | ||
2905 | } | 2910 | } |
2906 | 2911 | ||
2907 | # If we have no input at all, then there is nothing to report on | 2912 | # If we have no input at all, then there is nothing to report on |
@@ -2944,6 +2949,7 @@ sub process { | |||
2944 | if ($rpt_cleaners) { | 2949 | if ($rpt_cleaners) { |
2945 | print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n"; | 2950 | print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n"; |
2946 | print " scripts/cleanfile\n\n"; | 2951 | print " scripts/cleanfile\n\n"; |
2952 | $rpt_cleaners = 0; | ||
2947 | } | 2953 | } |
2948 | } | 2954 | } |
2949 | 2955 | ||