On Wed, 2008-10-15 at 22:02 -0700, David Miller wrote:
quoted
net/sched/sch_generic.c: In function 'dev_watchdog':
net/sched/sch_generic.c:224: warning: unused variable 'drivername'
Sucky, if WARN_ONCE() evaluates to nothing the sprintf() string buffer
on the stack looks unused.
I've complained about this to Arjan before, we actually lose all
messages passed to WARN() or WARN_ONCE() on platforms that use bug traps
for warnings too.
johannes
From: Johannes Berg <johannes@sipsolutions.net>
Date: Thu, 16 Oct 2008 16:57:19 +0200
On Wed, 2008-10-15 at 22:02 -0700, David Miller wrote:
quoted
quoted
net/sched/sch_generic.c: In function 'dev_watchdog':
net/sched/sch_generic.c:224: warning: unused variable 'drivername'
Sucky, if WARN_ONCE() evaluates to nothing the sprintf() string buffer
on the stack looks unused.
I've complained about this to Arjan before, we actually lose all
messages passed to WARN() or WARN_ONCE() on platforms that use bug traps
for warnings too.
Ok I see how that works, yes, it should be fixed.
If the platform defines a __WARN (which powerpc does) the
whole format string and printf args go unevaluated, it's
because of the following sequence in asm-generic/bug.h:
#ifndef __WARN
#ifndef __ASSEMBLY__
extern void warn_on_slowpath(const char *file, const int line);
extern void warn_slowpath(const char *file, const int line,
const char *fmt, ...) __attribute__((format(printf, 3, 4)));
#define WANT_WARN_ON_SLOWPATH
#endif
#define __WARN() warn_on_slowpath(__FILE__, __LINE__)
#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)
#else
#define __WARN_printf(arg...) __WARN()
#endif
On Thu, 16 Oct 2008 12:49:23 -0700 (PDT)
David Miller [off-list ref] wrote:
#endif
#define __WARN() warn_on_slowpath(__FILE__, __LINE__)
#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)
#else
#define __WARN_printf(arg...) __WARN()
the easiest way I suppose would be to do
#define __WARN_printf(arg..) do { printk(arg); __WARN(); } while (0)
any obvious problems with this ?
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
On Thu, 2008-10-16 at 13:02 -0700, Arjan van de Ven wrote:
On Thu, 16 Oct 2008 12:49:23 -0700 (PDT)
David Miller [off-list ref] wrote:
quoted
#endif
#define __WARN() warn_on_slowpath(__FILE__, __LINE__)
#define __WARN_printf(arg...) warn_slowpath(__FILE__, __LINE__, arg)
#else
#define __WARN_printf(arg...) __WARN()
the easiest way I suppose would be to do
#define __WARN_printf(arg..) do { printk(arg); __WARN(); } while (0)
any obvious problems with this ?
No, not really. You won't get it on kerneloops, but I guess that's not
an easily tractable problem.
johannes