From: Joe Perches Date: Fri, 5 Oct 2012 00:13:32 +0000 (-0700) Subject: checkpatch: update suggested printk conversions X-Git-Tag: v3.7~382^2~106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f26b8376faad26372a579606ecbd77b20e99dd8;p=platform%2Fkernel%2Flinux-amlogic.git checkpatch: update suggested printk conversions Direct conversion of printk(KERN_... to pr_ isn't the preferred conversion when a struct net_device or struct device is available. Hint that using netdev_ or dev_ is preferred to using pr_. Add netdev_dbg and dev_dbg variants too. Miscellaneous whitespace neatening of a misplaced close brace. Signed-off-by: Joe Perches Cc: Andy Whitcroft Cc: Greg KH Cc: Dan Carpenter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5ae9188..844af8b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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"); WARN("PREFER_PR_LEVEL", - "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*\(/) {