mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 3/3] Example use of WARN()
Date: Wed, 14 May 2008 20:43:14 -0700	[thread overview]
Message-ID: <20080514204314.01a9caa6@infradead.org> (raw)
In-Reply-To: <20080513213606.1a295609.akpm@linux-foundation.org>

On Tue, 13 May 2008 21:36:06 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 6 May 2008 23:21:56 -0700 Arjan van de Ven
> <arjan@infradead.org> wrote:
> 
> > From: Arjan van de Ven <arjan@linux.intel.com>
> > 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@linux.intel.com>
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@linux.intel.com>
---
 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


  parent reply	other threads:[~2008-05-15  3:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07  6:20 [patch 1/3] Rename WARN() to WARNING() to clear the namespace Arjan van de Ven
2008-05-07  6:21 ` [patch 2/3] Add a WARN() macro; this is WARN_ON() + printk arguments Arjan van de Ven
2008-05-07  6:21   ` [patch 3/3] Example use of WARN() Arjan van de Ven
2008-05-14  4:36     ` Andrew Morton
2008-05-14  4:51       ` Arjan van de Ven
2008-05-15  3:43       ` Arjan van de Ven [this message]
2008-05-07  6:41   ` [patch 2/3] Add a WARN() macro; this is WARN_ON() + printk arguments Vegard Nossum
2008-05-07 13:37     ` Arjan van de Ven
2008-05-07  7:31   ` Jiri Slaby
2008-05-07 12:46 ` [patch 1/3] Rename WARN() to WARNING() to clear the namespace Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080514204314.01a9caa6@infradead.org \
    --to=arjan@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®