Re: [patch 3/3] Example use of WARN()

From: Arjan van de Ven
Date: Wed May 14 2008 - 23:44:07 EST


On Tue, 13 May 2008 21:36:06 -0700
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Tue, 6 May 2008 23:21:56 -0700 Arjan van de Ven
> <arjan@xxxxxxxxxxxxx> wrote:
>
> > From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
> > Subject: Example use of WARN()
> >
> > now that WARN() exists, we can fold some of the printk's into it
>
> Wanna take a look at mips allnoconfig, please?
>

this should fix this


From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
Subject: [PATCH] Fix WARN() for the !CONFIG_BUG case

For the CONFIG_BUG=n case we need to provide a stub WARN() macro;
do this in the same style as WARN_ON() is done.

Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx>
---
include/asm-generic/bug.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index dcefa5e..1d2b51f 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -79,6 +79,14 @@ extern void warn_slowpath(const char *file, const int line, const char *fmt, ...
unlikely(__ret_warn_on); \
})
#endif
+
+#ifndef WARN
+#define WARN(condition, format...) ({ \
+ int __ret_warn_on = !!(condition); \
+ unlikely(__ret_warn_on); \
+})
+#endif
+
#endif

#define WARN_ON_ONCE(condition) ({ \
--
1.5.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/