* [PATCH] dynamic_debug: use printk(KERN_WARNING..) in stub function
@ 2012-05-01 11:23 Jim Cromie
2012-05-01 13:44 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Jim Cromie @ 2012-05-01 11:23 UTC (permalink / raw)
To: linux-kernel
Cc: Jim Cromie, Greg KH, linux-next, Roland Dreier, Jason Baron,
Joe Perches
drivers/infiniband/ulp/srp/ib_srp.c #defines pr_fmt() PFX fmt, but PFX
is not #defined until after <linux/*> headers are included.
This results in a bad expansion of the pr_warn() in the stub function.
2084c2084
< printk("<4>" PFX "dyndbg supported only in " "CONFIG_DYNAMIC_DEBUG builds\n")
---
> printk("<4>" "guano" "dyndbg supported only in " "CONFIG_DYNAMIC_DEBUG builds\n")
(END)
While that use-case is less than ideal, it will probably happen again,
and its easy to avoid by using raw printk().
To: Bart Van Assche bvanassche@acm.org
To: Stephen Rothwell <sfr@canb.auug.org.au>
CC: Greg KH <greg@kroah.com>
CC: linux-next@vger.kernel.org
CC: Roland Dreier <roland@purestorage.com>
CC: Jason Baron <jbaron@redhat.com>
CC: Joe Perches <joe@perches.com>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
include/linux/dynamic_debug.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index 4697e4b..c18257b 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -109,7 +109,8 @@ static inline int ddebug_dyndbg_module_param_cb(char *param, char *val,
const char *modname)
{
if (strstr(param, "dyndbg")) {
- pr_warn("dyndbg supported only in "
+ /* avoid pr_warn(), which wants pr_fmt() fully defined */
+ printk(KERN_WARNING "dyndbg param is supported only in "
"CONFIG_DYNAMIC_DEBUG builds\n");
return 0; /* allow and ignore */
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dynamic_debug: use printk(KERN_WARNING..) in stub function
2012-05-01 11:23 [PATCH] dynamic_debug: use printk(KERN_WARNING..) in stub function Jim Cromie
@ 2012-05-01 13:44 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2012-05-01 13:44 UTC (permalink / raw)
To: Jim Cromie
Cc: linux-kernel, linux-next, Roland Dreier, Jason Baron, Joe Perches
On Tue, May 01, 2012 at 05:23:12AM -0600, Jim Cromie wrote:
> drivers/infiniband/ulp/srp/ib_srp.c #defines pr_fmt() PFX fmt, but PFX
> is not #defined until after <linux/*> headers are included.
>
> This results in a bad expansion of the pr_warn() in the stub function.
>
> 2084c2084
> < printk("<4>" PFX "dyndbg supported only in " "CONFIG_DYNAMIC_DEBUG builds\n")
> ---
> > printk("<4>" "guano" "dyndbg supported only in " "CONFIG_DYNAMIC_DEBUG builds\n")
> (END)
>
> While that use-case is less than ideal, it will probably happen again,
> and its easy to avoid by using raw printk().
Thanks, now applied.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-01 13:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 11:23 [PATCH] dynamic_debug: use printk(KERN_WARNING..) in stub function Jim Cromie
2012-05-01 13:44 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).