diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2262e1f57fa6..e5bd60ff48e3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2382,6 +2382,19 @@ sub process { | |||
2382 | } | 2382 | } |
2383 | } | 2383 | } |
2384 | 2384 | ||
2385 | if ($line =~ /\bprintk\s*\(\s*KERN_([A-Z]+)/) { | ||
2386 | my $orig = $1; | ||
2387 | my $level = lc($orig); | ||
2388 | $level = "warn" if ($level eq "warning"); | ||
2389 | WARN("PREFER_PR_LEVEL", | ||
2390 | "Prefer pr_$level(... to printk(KERN_$1, ...\n" . $herecurr); | ||
2391 | } | ||
2392 | |||
2393 | if ($line =~ /\bpr_warning\s*\(/) { | ||
2394 | WARN("PREFER_PR_LEVEL", | ||
2395 | "Prefer pr_warn(... to pr_warning(...\n" . $herecurr); | ||
2396 | } | ||
2397 | |||
2385 | # function brace can't be on same line, except for #defines of do while, | 2398 | # function brace can't be on same line, except for #defines of do while, |
2386 | # or if closed on same line | 2399 | # or if closed on same line |
2387 | if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and | 2400 | if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and |