From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org,
linux-s390@vger.kernel.org
Subject: Re: [S390] Use generic bug.
Date: Tue, 6 Mar 2007 12:59:17 +0100 [thread overview]
Message-ID: <20070306115917.GA28321@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20070305.145629.28789919.davem@davemloft.net>
On Mon, Mar 05, 2007 at 02:56:29PM -0800, David Miller wrote:
> From: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Date: Mon, 5 Mar 2007 23:43:54 +0100
>
> > + if (__builtin_constant_p(__ret_warn_on)) { \
> > + if (__ret_warn_on) \
> > + __EMIT_BUG(BUGFLAG_WARNING); \
>
> I see we'll have this construct on powerpc, parisc and now s390.
>
> But if it's going to trigger essentially at compile time, I
> think it's much better to BUILD_BUG_ON() in this case instead
> of counting on the code path to actually run and the user to
> notice and report the kernel log message.
So something like WARN_ON(1) won't compile, but BUG_ON(1) still
would? Seems odd to me.
Also since there is nothing like WARN(), you have to use WARN_ON(1).
Btw.: sparc64 has plenty of these ;)
I would prefer to have something like a per arch defined WARN()
and a common code WARN_ON() like we have it already for BUG_ON().
Then I would agree: if WARN_ON() is used with a constant the build
should fail. Just to tell the author that he did something wrong
or simply should use WARN(). And of course the existing BUG_ON()
could be converted as well.
next prev parent reply other threads:[~2007-03-06 12:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 22:43 Martin Schwidefsky
2007-03-05 22:56 ` David Miller
2007-03-06 11:59 ` Heiko Carstens [this message]
2007-03-06 18:47 ` David Miller
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=20070306115917.GA28321@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
/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®