diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-10-20 02:28:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-20 13:26:38 -0400 |
commit | 8c7c7c9bf39470c9689ad43cae3142cf948f4cfb (patch) | |
tree | c9657aa9d52c505b9b8fd73e9292d9b2a533bad3 | |
parent | a31baca58cc16fe0584685f54c6d17494a231c92 (diff) |
[PATCH] Fix warnings for WARN_ON if CONFIG_BUG is disabled
In most cases the return value of WARN_ON() is ignored. If the generic
definition for the !CONFIG_BUG case is used this will result in a warning:
CC kernel/sched.o
In file included from include/linux/bio.h:25,
from include/linux/blkdev.h:14,
from kernel/sched.c:39:
include/linux/ioprio.h: In function âtask_ioprioâ:
include/linux/ioprio.h:50: warning: statement with no effect
kernel/sched.c: In function âcontext_switchâ:
kernel/sched.c:1834: warning: statement with no effect
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/asm-generic/bug.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 1d9573cf4a0b..c92ae0f166ff 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -37,7 +37,10 @@ | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #ifndef HAVE_ARCH_WARN_ON | 39 | #ifndef HAVE_ARCH_WARN_ON |
40 | #define WARN_ON(condition) unlikely((condition)) | 40 | #define WARN_ON(condition) ({ \ |
41 | typeof(condition) __ret_warn_on = (condition); \ | ||
42 | unlikely(__ret_warn_on); \ | ||
43 | }) | ||
41 | #endif | 44 | #endif |
42 | #endif | 45 | #endif |
43 | 46 | ||