Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_<level>

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joe Perches
Date: Wednesday, October 20, 2010 - 8:59 am

On Wed, 2010-10-20 at 09:42 +0200, Jean Delvare wrote:

http://lkml.org/lkml/2009/10/4/198
http://lkml.org/lkml/2009/10/5/215

I'd prefer something like that as well, and it is
a long-term goal I have, but not yet, no.

There are many files that use pr_<level> without pr_fmt.

Those need to be sorted out first, perhaps by adding a new
line to each of those files to "#define pr_fmt(fmt) fmt"

KBUILD_MODNAME is always #defined by the make system.

$ grep -rP --include=*.[ch] -lw "pr_(info|warn|warning|notice|debug|dbg|vdbg|crit|alert|err|emerg|cont)" * | \
	while read file ; do \
		grep -lwq pr_fmt $file ; \
		echo "$?:$file"; \
	done | \
 cut -f1 -d":" | sort | uniq -c 
    335 0
   1532 1

Exit status 0 means a match for pr_fmt.

So there are ~1900 files that use pr_<level>
in the kernel tree, only 335 have pr_fmt.

This search does have some false negatives because
some files use an #include that does a #define pr_fmt.

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.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Joe Perches, (Tue Oct 19, 4:13 pm)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Henrik Rydberg, (Tue Oct 19, 11:04 pm)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_<level>, Joe Perches, (Wed Oct 20, 8:59 am)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Guenter Roeck, (Wed Oct 20, 10:18 am)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Guenter Roeck, (Wed Oct 20, 10:48 am)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Guenter Roeck, (Wed Oct 20, 11:03 am)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Guenter Roeck, (Wed Oct 20, 11:35 am)
Re: [PATCH] drivers/hwmon: Use pr_fmt and pr_&lt;level&gt;, Davidlohr Bueso, (Wed Oct 20, 12:19 pm)