From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <1357230494.25181.55.camel@joe-AO722> Subject: Re: [PATCH] checkpatch: prefer dev_( to dev_printk(KERN_ From: Joe Perches To: Andy Whitcroft Cc: Andrew Morton , Lance Ortiz , bhelgaas@google.com, lance_ortiz@hotmail.com, jiang.liu@huawei.com, tony.luck@intel.com, bp@alien8.de, rostedt@goodmis.org, mchehab@redhat.com, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 03 Jan 2013 08:28:14 -0800 In-Reply-To: <20130103100808.GG2649@dm> References: <20130102232730.5706.82243.stgit@grignak.americas.hpqcorp.net> <20130102232743.5706.63153.stgit@grignak.americas.hpqcorp.net> <1357171594.25181.19.camel@joe-AO722> <20130103100808.GG2649@dm> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org List-ID: On Thu, 2013-01-03 at 10:08 +0000, Andy Whitcroft wrote: > On Wed, Jan 02, 2013 at 04:06:34PM -0800, Joe Perches wrote: > > Add YA check to printk style. > > > > dev_ uses are functions and generate smaller > > object code than dev_printk(KERN_. [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > > + if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) { > > + my $orig = $1; > > + my $level = lc($orig); > > + $level = "warn" if ($level eq "warning"); > > + my $level2 = $level; > > + $level2 = "dbg" if ($level eq "debug"); > > Is there some sublty I am not seeing here such that level2 is necessary? No, your vision is 20/20, it's not necessary. It was a copy/paste from the pr_ conversion above it where 2 styles to convert to (dev_dbg and pr_debug) are used. Here there is just one form and your review is appreciated. I'll submit a V2 later.