Skip to content

Commit

Permalink
[PATCH] Fix warnings for WARN_ON if CONFIG_BUG is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ralf Baechle authored and Linus Torvalds committed Oct 20, 2006
1 parent a31baca commit 8c7c7c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/asm-generic/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
#endif

#ifndef HAVE_ARCH_WARN_ON
#define WARN_ON(condition) unlikely((condition))
#define WARN_ON(condition) ({ \
typeof(condition) __ret_warn_on = (condition); \
unlikely(__ret_warn_on); \
})
#endif
#endif

Expand Down

0 comments on commit 8c7c7c9

Please sign in to comment.