Re: [PATCH] checkpatch: check for missing \n at the end of logging message

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

 



On Thu, 2020-04-09 at 09:24 +0200, Christophe JAILLET wrote:
> I think that, at least printk(), WARN() and co, and panic() should also 
> be handled the same way.

Maybe.

> A few files (5 according to my grep) also have something like:
>     #define pr_fmt(fmt) "bcache: %s()" fmt "\n", __func__
> and then sometimes a mix of pr_xxx() with either trailing \n or not.

Didn't know about those.

> Maybe those should be handled manually to be consistent and avoid a "\n" 
> in pr_fmt which is not widely used in other files

More likely the pr_fmt should have the \n removed and added
to the uses.

$ git grep -P 'define\s+pr_fmt.*\\n'
drivers/clocksource/timer-davinci.c:#define pr_fmt(fmt) "%s: " fmt "\n", __func__
drivers/md/bcache/bcache.h:#define pr_fmt(fmt) "bcache: %s() " fmt "\n", __func__
drivers/md/bcache/bset.c:#define pr_fmt(fmt) "bcache: %s() " fmt "\n", __func__
lib/math/prime_numbers.c:#define pr_fmt(fmt) "prime numbers: " fmt "\n"
lib/percpu-refcount.c:#define pr_fmt(fmt) "%s: " fmt "\n", __func__
lib/test_hash.c:#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt "\n"
tools/usb/usbip/libsrc/usbip_common.h:#define pr_fmt(fmt)       "%s: %s: " fmt "\n", PROGNAME






[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux