On Thu, 2020-04-09 at 09:24 +0200, Christophe JAILLET wrote:Yes agreed.
I think that, at least printk(), WARN() and co, and panic() should alsoMaybe.
be handled the same way.
A few files (5 according to my grep) also have something like:Didn't know about those.
#define pr_fmt(fmt) "bcache: %s()" fmt "\n", __func__
and then sometimes a mix of pr_xxx() with either trailing \n or not.
Maybe those should be handled manually to be consistent and avoid a "\n"More likely the pr_fmt should have the \n removed and added
in pr_fmt which is not widely used in other files
to the uses.
$ git grep -P 'define\s+pr_fmt.*\\n'https://marc.info/?l=linux-kernel&m=158642435216181&w=4 (which has been acked)
drivers/clocksource/timer-davinci.c:#define pr_fmt(fmt) "%s: " fmt "\n", __func__
lib/math/prime_numbers.c:#define pr_fmt(fmt) "prime numbers: " fmt "\n"Patches proposed.
lib/test_hash.c:#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt "\n"
lib/percpu-refcount.c:#define pr_fmt(fmt) "%s: " fmt "\n", __func__In this file, there are some WARN_ON.
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__
tools/usb/usbip/libsrc/usbip_common.h:#define pr_fmt(fmt) "%s: %s: " fmt "\n", PROGNAME