diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2bb08a962ce3..f9afd075e109 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2430,6 +2430,15 @@ sub process { | |||
2430 | "Prefer pr_warn(... to pr_warning(...\n" . $herecurr); | 2430 | "Prefer pr_warn(... to pr_warning(...\n" . $herecurr); |
2431 | } | 2431 | } |
2432 | 2432 | ||
2433 | if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) { | ||
2434 | my $orig = $1; | ||
2435 | my $level = lc($orig); | ||
2436 | $level = "warn" if ($level eq "warning"); | ||
2437 | $level = "dbg" if ($level eq "debug"); | ||
2438 | WARN("PREFER_DEV_LEVEL", | ||
2439 | "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr); | ||
2440 | } | ||
2441 | |||
2433 | # function brace can't be on same line, except for #defines of do while, | 2442 | # function brace can't be on same line, except for #defines of do while, |
2434 | # or if closed on same line | 2443 | # or if closed on same line |
2435 | if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and | 2444 | if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and |