Re: [PATCH 00/49] staging: Convert printk(KERN_<LEVEL> to pr_<level>

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

 



On Wed, Oct 14, 2009 at 07:09:48PM -0700, Greg KH wrote:
> On Wed, Oct 14, 2009 at 06:53:44PM -0700, Joe Perches wrote:
> > Where appropriate:
> > Use #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt or
> >     #define pr_fmt(fmt) "some prefix: " fmt
> > Remove prefixes
> > Remove direct function names and use %s...__func__
> > Convert __FUNCTION__ to __func__
> > Convert some printks to pr_cont
> > Convert printk(KERN_<LEVEL> to pr_<level>(
> > Integrated long strings
> >
> > Did not do much conversions of bare printks
> >
> > Some of these are uncompiled and all of them
> > are untested.
> >
> > Mostly done via a perl script and some emacs macros:
> >
> > $ for file in $(find drivers/staging -name "*.[ch]") ; do \
> >   perl -i -e ' \
> >        local $/; \
> >        while (<>) { \
> >          s@\bprintk\s*\(\s*KERN_(INFO|WARNING|ERR|ALERT|CRIT|EMERG|NOTICE)\s*@pr_\L$1\(@g; \
> >                s@\b(pr_[^;]+)\"\s*\n\s*\"@$1@g; \
> >                s@\b(pr_[^;]+)\"\s*\n\s*\"@$1@g; \
> >                s@\b(pr_[^;]+)\"\s*\n\s*\"@$1@g; \
> >                print; \
> >        }' $file ; \
> > done
> 
> I hate patches done by scripts, as they usually are wrong.  Like these
> :(

FWIW, coccinelle spatch should work better but I have found issues
with spatch on headers, it just won't touch them, for instance. But
in this case wouldn't it be safer to use it first for all C files
and then leave a script to finish he job later?

  Luis
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux