public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: Joe Perches <joe@perches.com>
Cc: Jean Delvare <khali@linux-fr.org>,
	Hans de Goede <j.w.r.degoede@hhs.nl>,
	Alistair John Strachan <alistair@devzero.co.uk>,
	Henrik Rydberg <rydberg@euromail.se>,
	"Mark M. Hoffman" <mhoffman@lightlink.com>,
	Luca Tettamanti <kronos.it@gmail.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Juerg Haefliger <juergh@gmail.com>,
	Eric Piel <eric.piel@tremplin-utc.net>,
	Jim Cromie <jim.cromie@gmail.com>,
	Roger Lucas <vt8231@hiddenengine.co.uk>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_<level>
Date: Wed, 20 Oct 2010 10:48:46 -0700	[thread overview]
Message-ID: <20101020174846.GA22819@ericsson.com> (raw)
In-Reply-To: <1287595700.1813.202.camel@Joe-Laptop>

On Wed, Oct 20, 2010 at 01:28:20PM -0400, Joe Perches wrote:
> On Wed, 2010-10-20 at 10:18 -0700, Guenter Roeck wrote:
> > On Wed, Oct 20, 2010 at 12:54:20PM -0400, Joe Perches wrote:
> > > On Wed, 2010-10-20 at 09:49 -0700, Guenter Roeck wrote:
> > > > On Wed, Oct 20, 2010 at 11:59:23AM -0400,
> > > >  Joe Perches wrote:
> > > > [ ... ]
> > > > > Anyway, I'd like to sort it out eventually.
> > > > > For now, I just add the #define pr_fmt, with
> > > > > a long term goal of removing them all and using
> > > > > a different mechanism to remove the duplicated
> > > > > prefix string altogether from the formats and
> > > > > save some text.
> > > > I don't mind individual pr_fmt defines as long as they are used.
> > > > However, that is not the case in many of the patches.
> > > > Just adding a pr_fmt define to a file without using it doesn't make sense to me.
> > > kernel.h has the equivalent of:
> > > #define pr_<level>(fmt, arg...) printk(KERN_<level> pr_fmt(fmt), ##arg)
> > > 
> > And no one minds that there are literally hundreds of equivalent defines
> > for pr_fmt in the code, and even more conflicting ones ? Odd.
> > 
> > Maybe the following in kernel.h would make more sense.
> > 
> > #ifndef pr_fmt
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > #endif
> > 
> > At least it would make more sense than littering source files with pr_fmt definitions.
> > If that doesn't fly, I would prefer to stick with the existing default definition in kernel.h.
> 
> That would give you no prefix at all and make the
> logging messages harder to distinguish.
> 
Exactly my point.

> > At least that would give people an incentive to fix the problem in kernel.h (or in some other
> > central location) if they dislike the resulting missing module names.
> 
> I don't think it flies for another year or two.
> 
> $ grep -Prh --include=*.[ch] "define\s*pr_fmt" * | \
> 	perl -p -e 's/[ \t]+/ /g' | \
> 	sort | uniq -c | sort -rn
>     211 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>      93 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
>      16 #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
>      16 #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
>       4 #define pr_fmt(fmt) "intc: " fmt
>       4 #define pr_fmt(fmt) "ep93xx " KBUILD_MODNAME ": " fmt
>       3 #define pr_fmt(fmt) "%s: " fmt, __func__
>       3 #define pr_fmt(fmt) DRV_MODULE_NAME ": " fmt
>       2 #define pr_fmt(fmt) "gcov: " fmt
>       2 #define pr_fmt(fmt) fmt
>       2 #define pr_fmt(fmt) DRV_NAME ": " fmt
>       1 #define pr_fmt(fmt) "viod: " fmt
>       1 #define pr_fmt(fmt) "tboot: " fmt
>       1 #define pr_fmt(fmt) "(stll) :" fmt
>       1 #define pr_fmt(fmt) "(stk) :" fmt
>       1 #define pr_fmt(fmt) "(stc): " fmt
>       1 #define pr_fmt(fmt) "PMU: " fmt
>       1 #define pr_fmt(fmt) "pit: " fmt
>       1 #define pr_fmt(fmt) "phram: " fmt
>       1 #define pr_fmt(fmt) "PCI: " fmt
>       1 #define pr_fmt(fmt) "module %s: " fmt
>       1 #define pr_fmt(fmt) "mmiotrace: " fmt
>       1 #define pr_fmt(fmt) KBUILD_MODNAME " WATCHDOG: " fmt
>       1 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt /* Append 'batman-adv: ' before
>       1 #define pr_fmt(fmt) KBUILD_MODNAME " " fmt
>       1 #define pr_fmt(fmt) KBUILD_BASENAME ": " fmt
>       1 #define pr_fmt(fmt) "isram: " fmt
>       1 #define pr_fmt(fmt) "hw perfevents: " fmt
>       1 #define pr_fmt(fmt) "hw-breakpoint: " fmt
>       1 #define pr_fmt(fmt) DRIVER_NAME ": " fmt
>       1 #define pr_fmt(fmt) "cxgb: " fmt
>       1 #define pr_fmt(fmt) "cn_test: " fmt
>       1 #define pr_fmt(fmt) "clock: " fmt
>       1 #define pr_fmt(fmt) "acerhdf: " fmt
> 
The modified define in kernel.org would only apply if pr_fmt isn't already defined,
so that argument is not really correct. The real difference would be that you could
then remove the individual pr_fmt defines from 211 files, and all users of pr_fmt
without module name (ie those hard to read) would be easier to read/identify.

Guenter


  reply	other threads:[~2010-10-20 17:49 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 23:13 [PATCH] drivers/hwmon: Use pr_fmt and pr_<level> Joe Perches
2010-10-20  3:29 ` Guenter Roeck
2010-10-20  3:34   ` Joe Perches
2010-10-20  3:53     ` Guenter Roeck
2010-10-20  4:07       ` Joe Perches
2010-10-20  6:04         ` Henrik Rydberg
2010-10-20  7:34         ` Jean Delvare
2010-10-20 14:46           ` Guenter Roeck
2010-10-20 16:08             ` Joe Perches
2010-10-20 16:45               ` Jean Delvare
2010-10-20 16:38             ` Jean Delvare
2010-10-20 16:43               ` Guenter Roeck
2010-10-20 16:46                 ` Jean Delvare
2010-10-20 18:03                   ` Guenter Roeck
2010-10-20 16:27           ` Joe Perches
2010-10-20 16:42             ` Jean Delvare
2010-10-20  6:51       ` [PATCH 00/32] " Joe Perches
2010-10-20  6:51         ` [PATCH 01/32] drivers/hwmon/abituguru.c: " Joe Perches
2010-11-09 16:25           ` [01/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 02/32] drivers/hwmon/abituguru3.c: " Joe Perches
2010-11-09 16:28           ` [02/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 03/32] drivers/hwmon/adt7470.c: " Joe Perches
2010-11-09 16:29           ` [03/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 04/32] drivers/hwmon/applesmc.c: " Joe Perches
2010-10-20  9:54           ` Henrik Rydberg
2010-11-09 16:35           ` [04/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 05/32] drivers/hwmon/asb100.c: " Joe Perches
2010-11-09 16:35           ` [05/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 06/32] drivers/hwmon/asus_atk0110.c: " Joe Perches
2010-11-09 16:37           ` [06/32] " Guenter Roeck
2010-11-09 20:15             ` Luca Tettamanti
2010-11-09 20:34               ` Guenter Roeck
2010-10-20  6:51         ` [PATCH 07/32] drivers/hwmon/coretemp.c: " Joe Perches
2010-11-09 16:38           ` [07/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 08/32] drivers/hwmon/dme1737.c: " Joe Perches
2010-11-09 16:39           ` [08/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 09/32] drivers/hwmon/f71805f.c: " Joe Perches
2010-11-09 16:40           ` [09/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 10/32] drivers/hwmon/f71882fg.c: " Joe Perches
2010-11-09 16:41           ` [10/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 11/32] drivers/hwmon/hp_accel.c: " Joe Perches
2010-11-09 16:42           ` [11/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 12/32] drivers/hwmon/hwmon-vid.c: " Joe Perches
2010-11-09 16:43           ` [12/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 13/32] drivers/hwmon/hwmon.c: " Joe Perches
2010-11-09 16:44           ` [13/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 14/32] drivers/hwmon/ibmaem.c: " Joe Perches
2010-11-09 16:44           ` [14/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 15/32] drivers/hwmon/it87.c: " Joe Perches
2010-11-09  9:21           ` Jean Delvare
2010-10-20  6:51         ` [PATCH 16/32] drivers/hwmon/lis3lv02d.c: " Joe Perches
2010-11-09 16:46           ` [16/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 17/32] drivers/hwmon/lm70.c: " Joe Perches
2010-11-09 16:47           ` [17/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 18/32] drivers/hwmon/lm78.c: " Joe Perches
2010-11-09  9:25           ` Jean Delvare
2010-10-20  6:51         ` [PATCH 19/32] drivers/hwmon/pc87360.c: " Joe Perches
2010-11-09  9:31           ` Jean Delvare
2010-11-09  9:59             ` Joe Perches
2010-11-09 12:08               ` Jean Delvare
2010-10-20  6:51         ` [PATCH 20/32] drivers/hwmon/pc87427.c: " Joe Perches
2010-11-09  9:35           ` Jean Delvare
2010-10-20  6:51         ` [PATCH 21/32] drivers/hwmon/pcf8591.c: " Joe Perches
2010-11-09 16:49           ` [21/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 22/32] drivers/hwmon/pkgtemp.c: " Joe Perches
2010-11-09 16:50           ` [22/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 23/32] drivers/hwmon/sis5595.c: " Joe Perches
2010-11-09 16:51           ` [23/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 24/32] drivers/hwmon/smsc47b397.c: " Joe Perches
2010-11-09 16:51           ` [24/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 25/32] drivers/hwmon/smsc47m1.c: " Joe Perches
2010-11-09 16:52           ` [25/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 26/32] drivers/hwmon/via-cputemp.c: " Joe Perches
2010-11-09 16:53           ` [26/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 27/32] drivers/hwmon/via686a.c: " Joe Perches
2010-11-09 16:54           ` [27/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 28/32] drivers/hwmon/vt1211.c: " Joe Perches
2010-11-09 16:57           ` [28/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 29/32] drivers/hwmon/vt8231.c: " Joe Perches
2010-11-09 16:58           ` [29/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 30/32] drivers/hwmon/w83627ehf.c: " Joe Perches
2010-11-09 16:59           ` [30/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 31/32] drivers/hwmon/w83627hf.c: " Joe Perches
2010-11-09 17:00           ` [31/32] " Guenter Roeck
2010-10-20  6:51         ` [PATCH 32/32] drivers/hwmon/w83781d.c: " Joe Perches
2010-11-09  9:39           ` Jean Delvare
2010-11-09 10:04             ` Joe Perches
2010-10-20  7:42 ` [PATCH] drivers/hwmon: " Jean Delvare
2010-10-20 15:59   ` Joe Perches
2010-10-20 16:49     ` Guenter Roeck
2010-10-20 16:54       ` Joe Perches
2010-10-20 17:18         ` Guenter Roeck
2010-10-20 17:28           ` Joe Perches
2010-10-20 17:48             ` Guenter Roeck [this message]
2010-10-20 18:02               ` Joe Perches
2010-10-20 18:35                 ` Guenter Roeck
2010-10-20 19:08                   ` Joe Perches
2010-10-20 19:57                   ` Jean Delvare
2010-10-20 19:19   ` Davidlohr Bueso
2010-10-20 19:38     ` Jean Delvare
2010-10-20 19:52       ` Joe Perches
2010-10-20 19:59         ` Joe Perches
2010-10-20 20:36           ` Jim Cromie
2010-10-20 20:13         ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101020174846.GA22819@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=alistair@devzero.co.uk \
    --cc=eric.piel@tremplin-utc.net \
    --cc=fenghua.yu@intel.com \
    --cc=j.w.r.degoede@hhs.nl \
    --cc=jim.cromie@gmail.com \
    --cc=joe@perches.com \
    --cc=juergh@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=kronos.it@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mhoffman@lightlink.com \
    --cc=rydberg@euromail.se \
    --cc=vt8231@hiddenengine.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox