Messages in this thread | | | Subject | Re: [RFC] Remove most all #define pr_fmt(fmt) lines | From | Joe Perches <> | Date | Wed, 28 Mar 2012 01:03:40 -0700 |
| |
On Wed, 2012-03-28 at 09:42 +0200, Geert Uytterhoeven wrote: > On Tue, Mar 27, 2012 at 19:23, Joe Perches <joe@perches.com> wrote: > > #ifndef pr_fmt > > + > > +#ifndef pr_fmt_std > > +#define pr_fmt_std(fmt) KBUILD_MODNAME ": " fmt > > +#endif > > +#ifndef pr_fmt_dbg > > +#define pr_fmt_dbg(fmt) fmt > > +#endif > > #define pr_fmt(fmt) fmt > > What's the rationale behind the above line? > I had expected > > #define pr_fmt(fmt) pr_fmt_std(fmt)
Keeping current pr_debug output as similar to possible to the output produced by this patch.
pr_debug predates pr_fmt by quite awhile, it dates back from kernel version 2.0 days, and there are _many_ instances of pr_debug in files without a pr_fmt define.
The other defines of pr_<level> were introduced more or less the same time as pr_fmt so there aren't _too_ many that couldn't reasonably be prefixed.
commit d091c2f58ba32029495a933b721e8e02fbd12caa Author: Martin Schwidefsky <schwidefsky@de.ibm.com> Date: Wed Nov 12 21:16:43 2008 +0100
Add 'pr_fmt()' format modifier to pr_xyz macros.
commit 1f7c8234c7a68c2ccc2a33f3b7d48057980e7c35 Author: Emil Medve <Emilian.Medve@Freescale.com> Date: Tue Oct 16 23:29:48 2007 -0700
Make the pr_*() family of macros in kernel.h complete
> > +#ifndef pr_fmt_std > > +#define pr_fmt_std(fmt...) pr_fmt(fmt) > > Why the "fmt..." here, and "fmt" in the definitions above?
Where pr_fmt is already defined, these pr_fmt_std and _dbg macros must work with pr_fmt defines like:
#define pr_fmt(fmt) "my special prefix:%s:%d", __func__, __LINE__
| |