Commit f80063e9 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc32: Reduce WARN_ON(0) to nothing

The last patch I sent means that we have WARN_ON(0) in a couple of
places when CONFIG_PREEMPT=n.  This patch makes that reduce to
nothing (rather than a conditional trap on a 0 value), and also makes
BUG_ON(0) reduce to nothing for completeness.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 717f8850
...@@ -23,26 +23,30 @@ struct bug_entry { ...@@ -23,26 +23,30 @@ struct bug_entry {
: : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
} while (0) } while (0)
#define BUG_ON(x) do { \ #define BUG_ON(x) do { \
__asm__ __volatile__( \ if (!__builtin_constant_p(x) || (x)) { \
"1: twnei %0,0\n" \ __asm__ __volatile__( \
".section __bug_table,\"a\"\n\t" \ "1: twnei %0,0\n" \
" .long 1b,%1,%2,%3\n" \ ".section __bug_table,\"a\"\n\t" \
".previous" \ " .long 1b,%1,%2,%3\n" \
: : "r" (x), "i" (__LINE__), "i" (__FILE__), \ ".previous" \
"i" (__FUNCTION__)); \ : : "r" (x), "i" (__LINE__), "i" (__FILE__), \
"i" (__FUNCTION__)); \
} \
} while (0) } while (0)
#define PAGE_BUG(page) do { BUG(); } while (0) #define PAGE_BUG(page) BUG()
#define WARN_ON(x) do { \ #define WARN_ON(x) do { \
__asm__ __volatile__( \ if (!__builtin_constant_p(x) || (x)) { \
"1: twnei %0,0\n" \ __asm__ __volatile__( \
".section __bug_table,\"a\"\n\t" \ "1: twnei %0,0\n" \
" .long 1b,%1,%2,%3\n" \ ".section __bug_table,\"a\"\n\t" \
".previous" \ " .long 1b,%1,%2,%3\n" \
: : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \ ".previous" \
"i" (__FILE__), "i" (__FUNCTION__)); \ : : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \
"i" (__FILE__), "i" (__FUNCTION__)); \
} \
} while (0) } while (0)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment