Skip to contentSkip to conversation

x86_64: silence warning when stack unwinding is disabled

PATCH In review Mikael Pettersson 3 participants 4 messages Sep 21, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64: silence warning when stack unwinding is disabled

Compiling kernel 2.6.18 on x86_64 with CONFIG_STACK_UNWIND=n gives:

arch/x86_64/kernel/traps.c: In function 'show_trace':
arch/x86_64/kernel/traps.c:287: warning: cast to pointer from integer of different size

This is because UNW_SP() evaluates to 0, of type int, which is cast to a pointer by traps.c. Fix: evaluate to 0UL instead.

include/asm-x86_64/unwind.h renamed from include/asm-x86_64/unwind.h.~1~ +1 -1
@@ -95,7 +95,7 @@ static inline int arch_unw_user_mode(con
 #else
 
 #define UNW_PC(frame) ((void)(frame), 0)
-#define UNW_SP(frame) ((void)(frame), 0)
+#define UNW_SP(frame) ((void)(frame), 0UL)
 
 static inline int arch_unw_user_mode(const void *info)
 {
#1 lore raw

A patch to this effect is already queued in -mm (and perhaps also in Andi's tree). Jan

Quoted 1 line
Quoted 1 line
Quoted 1 line

Mikael Pettersson <[email protected]> 21.09.06 09:12 >>>

Compiling kernel 2.6.18 on x86_64 with CONFIG_STACK_UNWIND=n gives:

arch/x86_64/kernel/traps.c: In function 'show_trace':
arch/x86_64/kernel/traps.c:287: warning: cast to pointer from integer of different size

This is because UNW_SP() evaluates to 0, of type int, which is cast to a pointer by traps.c. Fix: evaluate to 0UL instead.

include/asm-x86_64/unwind.h renamed from include/asm-x86_64/unwind.h.~1~ +1 -1
@@ -95,7 +95,7 @@ static inline int arch_unw_user_mode(con
 #else
 
 #define UNW_PC(frame) ((void)(frame), 0)
-#define UNW_SP(frame) ((void)(frame), 0)
+#define UNW_SP(frame) ((void)(frame), 0UL)
 
 static inline int arch_unw_user_mode(const void *info)
 {
#2 lore raw
Quoted 1 line · Jan Beulich

A patch to this effect is already queued in -mm (and perhaps also in Andi's tree). Jan

I refixed it independently a few minutes ago.

There was also another compile error in my tree with unwind disabled which I fixed.

-Andi

#3 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line

Andi Kleen <[email protected]> 21.09.06 10:04 >>>

Quoted 1 line · Jan Beulich

A patch to this effect is already queued in -mm (and perhaps also in Andi's tree). Jan

I refixed it independently a few minutes ago.

There was also another compile error in my tree with unwind disabled which I fixed.

Thanks!