Commit 8f26b837 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: update suggested printk conversions

Direct conversion of printk(KERN_<LEVEL>...  to pr_<level> isn't the
preferred conversion when a struct net_device or struct device is

Hint that using netdev_<level> or dev_<level> is preferred to using
pr_<level>.  Add netdev_dbg and dev_dbg variants too.

Miscellaneous whitespace neatening of a misplaced close brace.
Signed-off-by: default avatarJoe Perches <>
Cc: Andy Whitcroft <>
Cc: Greg KH <>
Cc: Dan Carpenter <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent fa64205d
......@@ -421,7 +421,7 @@ sub top_of_kernel_tree {
return 1;
sub parse_email {
my ($formatted_email) = @_;
......@@ -2399,8 +2399,10 @@ sub process {
my $orig = $1;
my $level = lc($orig);
$level = "warn" if ($level eq "warning");
my $level2 = $level;
$level2 = "dbg" if ($level eq "debug");
"Prefer pr_$level(... to printk(KERN_$1, ...\n" . $herecurr);
"Prefer netdev_$level2(netdev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr);
if ($line =~ /\bpr_warning\s*\(/) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment