Re: [PATCH] checkpatch: prefer dev_<level>( to dev_printk(KERN_<LEVEL>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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_<level> uses are functions and generate smaller
> > object code than dev_printk(KERN_<LEVEL>.
[]
> > 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_<level> 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.


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux