Skip to contentSkip to conversation

make powerpc BUG_ON() OK with pointers and bitwise

PATCH In review Al Viro 2 participants 2 messages Jul 26, 2007

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 make powerpc BUG_ON() OK with pointers and bitwise

Since powerpc insists on printing the _value_ of condition and on casting it to long... At least let's make it a force-cast.

---
 include/asm-powerpc/bug.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-powerpc/bug.h +1 -1
index f6fa394..a248b8b 100644
@@ -79,7 +79,7 @@
 		_EMIT_BUG_ENTRY					\
 		: : "i" (__FILE__), "i" (__LINE__), "i" (0),	\
 		  "i" (sizeof(struct bug_entry)),		\
-		  "r" ((long)(x)));				\
+		  "r" ((__force long)(x)));			\
 	}							\
 } while (0)
 
Signature · 1 line
1.5.3.GIT
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Al Viro

Since powerpc insists on printing the _value_ of condition

We don't _print_ the value of the condition, we give it to a conditional-trap instruction which will trap if it is non-zero.

Quoted 1 line

and on casting it to long... At least let's make it a force-cast.

The long cast is to make sure it's sign-extended to the full register width. Adding __force looks fine.

Quoted 1 line