mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
checkpatch: suggest pr_<level> over printk(KERN_<LEVEL>
Suggest the shorter pr_<level> instead of printk(KERN_<LEVEL>. Prefer to use pr_<level> over bare printks. Prefer to use pr_warn over pr_warning. Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@shadowen.org> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
9a4cad4e25
commit
243f3803cf
1 changed files with 13 additions and 0 deletions
|
@ -2382,6 +2382,19 @@ sub process {
|
|||
}
|
||||
}
|
||||
|
||||
if ($line =~ /\bprintk\s*\(\s*KERN_([A-Z]+)/) {
|
||||
my $orig = $1;
|
||||
my $level = lc($orig);
|
||||
$level = "warn" if ($level eq "warning");
|
||||
WARN("PREFER_PR_LEVEL",
|
||||
"Prefer pr_$level(... to printk(KERN_$1, ...\n" . $herecurr);
|
||||
}
|
||||
|
||||
if ($line =~ /\bpr_warning\s*\(/) {
|
||||
WARN("PREFER_PR_LEVEL",
|
||||
"Prefer pr_warn(... to pr_warning(...\n" . $herecurr);
|
||||
}
|
||||
|
||||
# function brace can't be on same line, except for #defines of do while,
|
||||
# or if closed on same line
|
||||
if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
|
||||
|
|
Loading…
Reference in a new issue