* [PATCH] Fix WARN_ON() on bitfield ops for all other archs
@ 2007-08-01 22:18 Heiko Carstens
2007-08-02 3:04 ` Paul Mundt
2007-08-02 3:44 ` Satyam Sharma
0 siblings, 2 replies; 3+ messages in thread
From: Heiko Carstens @ 2007-08-01 22:18 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: Alexey Dobriyan, Herbert Xu, Paul Mundt, Haavard Skinnemoen,
Matthew Wilcox, Kyle McMartin, Martin Schwidefsky, linux-kernel
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Fixes WARN_ON() on bitfiels ops for all architectures that have
been left out in 8d4fbcfbe0a4bfc73e7f0297c59ae514e1f1436f.
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
include/asm-avr32/bug.h | 2 +-
include/asm-parisc/bug.h | 2 +-
include/asm-s390/bug.h | 2 +-
include/asm-sh/bug.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6/include/asm-avr32/bug.h
===================================================================
--- linux-2.6.orig/include/asm-avr32/bug.h
+++ linux-2.6/include/asm-avr32/bug.h
@@ -57,7 +57,7 @@
#define WARN_ON(condition) \
({ \
- typeof(condition) __ret_warn_on = (condition); \
+ int __ret_warn_on = !!(condition); \
if (unlikely(__ret_warn_on)) \
_BUG_OR_WARN(BUGFLAG_WARNING); \
unlikely(__ret_warn_on); \
Index: linux-2.6/include/asm-parisc/bug.h
===================================================================
--- linux-2.6.orig/include/asm-parisc/bug.h
+++ linux-2.6/include/asm-parisc/bug.h
@@ -74,7 +74,7 @@
#define WARN_ON(x) ({ \
- typeof(x) __ret_warn_on = (x); \
+ int __ret_warn_on = !!(x); \
if (__builtin_constant_p(__ret_warn_on)) { \
if (__ret_warn_on) \
__WARN(); \
Index: linux-2.6/include/asm-s390/bug.h
===================================================================
--- linux-2.6.orig/include/asm-s390/bug.h
+++ linux-2.6/include/asm-s390/bug.h
@@ -50,7 +50,7 @@
#define BUG() __EMIT_BUG(0)
#define WARN_ON(x) ({ \
- typeof(x) __ret_warn_on = (x); \
+ int __ret_warn_on = !!(x); \
if (__builtin_constant_p(__ret_warn_on)) { \
if (__ret_warn_on) \
__EMIT_BUG(BUGFLAG_WARNING); \
Index: linux-2.6/include/asm-sh/bug.h
===================================================================
--- linux-2.6.orig/include/asm-sh/bug.h
+++ linux-2.6/include/asm-sh/bug.h
@@ -61,7 +61,7 @@ do { \
} while (0)
#define WARN_ON(x) ({ \
- typeof(x) __ret_warn_on = (x); \
+ int __ret_warn_on = !!(x); \
if (__builtin_constant_p(__ret_warn_on)) { \
if (__ret_warn_on) \
__WARN(); \
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Fix WARN_ON() on bitfield ops for all other archs
2007-08-01 22:18 [PATCH] Fix WARN_ON() on bitfield ops for all other archs Heiko Carstens
@ 2007-08-02 3:04 ` Paul Mundt
2007-08-02 3:44 ` Satyam Sharma
1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2007-08-02 3:04 UTC (permalink / raw)
To: Heiko Carstens
Cc: Linus Torvalds, Andrew Morton, Alexey Dobriyan, Herbert Xu,
Haavard Skinnemoen, Matthew Wilcox, Kyle McMartin,
Martin Schwidefsky, linux-kernel
On Thu, Aug 02, 2007 at 12:18:38AM +0200, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>
> Fixes WARN_ON() on bitfiels ops for all architectures that have
> been left out in 8d4fbcfbe0a4bfc73e7f0297c59ae514e1f1436f.
>
> Cc: Alexey Dobriyan <adobriyan@sw.ru>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
> Cc: Matthew Wilcox <matthew@wil.cx>
> Cc: Kyle McMartin <kyle@parisc-linux.org>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix WARN_ON() on bitfield ops for all other archs
2007-08-01 22:18 [PATCH] Fix WARN_ON() on bitfield ops for all other archs Heiko Carstens
2007-08-02 3:04 ` Paul Mundt
@ 2007-08-02 3:44 ` Satyam Sharma
1 sibling, 0 replies; 3+ messages in thread
From: Satyam Sharma @ 2007-08-02 3:44 UTC (permalink / raw)
To: Heiko Carstens
Cc: Linus Torvalds, Andrew Morton, Alexey Dobriyan, Herbert Xu,
Paul Mundt, Haavard Skinnemoen, Matthew Wilcox, Kyle McMartin,
Martin Schwidefsky, linux-kernel
On Thu, 2 Aug 2007, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>
> Fixes WARN_ON() on bitfiels ops for all architectures that have
> been left out in 8d4fbcfbe0a4bfc73e7f0297c59ae514e1f1436f.
Well, considering ...
On Tue, 31 Jul 2007, Alexey Dobriyan wrote:
> But I question the rationale of that commit:
> [...]
> I think that second case is more clear and immediately understandable.
and
On Tue, 31 Jul 2007, Linus Torvalds wrote:
> For all I know, the proper solution is
> to just revert the whole mess, and *not* make WARN_ON() return a value
> at all, since that seems to be the fundamental mistake here.
... I think it makes sense to stop returning the value from WARN_ON()
in the first place. There's only 5 places in the tree that uses its
return value anyway, and one of them ( net/xfrm/xfrm_policy.c:681 )
is a good example of why it's less readable that way.
Satyam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-02 3:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-01 22:18 [PATCH] Fix WARN_ON() on bitfield ops for all other archs Heiko Carstens
2007-08-02 3:04 ` Paul Mundt
2007-08-02 3:44 ` Satyam Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox