Skip to contentSkip to conversation

kprobe: missing cast

PATCH In review Stephen Hemminger 3 participants 3 messages Jan 15, 2008 – Jan 16, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kprobe: missing cast

Fix warning from missing cast, maybe a result of the x86 merge?

CC arch/x86/kernel/kprobes_32.o
arch/x86/kernel/kprobes_32.c: In function ‘longjmp_break_handler’:
arch/x86/kernel/kprobes_32.c:729: warning: comparison of distinct pointer types lacks a cast

arch/x86/kernel/kprobes_32.c +1 -1
@@ -726,7 +726,7 @@ int __kprobes longjmp_break_handler(stru
 	struct jprobe *jp = container_of(p, struct jprobe, kp);
 
 	if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) {
-		if (&regs->esp != kcb->jprobe_saved_esp) {
+		if ((unsigned long *) &regs->esp != kcb->jprobe_saved_esp) {
 			struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
 			printk("current esp %p does not match saved esp %p\n",
 			       &regs->esp, kcb->jprobe_saved_esp);
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Stephen Hemminger

Fix warning from missing cast, maybe a result of the x86 merge?

Thanks Stephen!

Ananth

Quoted 16 lines

CC arch/x86/kernel/kprobes_32.o
arch/x86/kernel/kprobes_32.c: In function ‘longjmp_break_handler’:
arch/x86/kernel/kprobes_32.c:729: warning: comparison of distinct pointer types lacks a cast

arch/x86/kernel/kprobes_32.c +1 -1
@@ -726,7 +726,7 @@ int __kprobes longjmp_break_handler(stru
 	struct jprobe *jp = container_of(p, struct jprobe, kp);
 
 	if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) {
-		if (&regs->esp != kcb->jprobe_saved_esp) {
+		if ((unsigned long *) &regs->esp != kcb->jprobe_saved_esp) {
 			struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
 			printk("current esp %p does not match saved esp %p\n",
 			       &regs->esp, kcb->jprobe_saved_esp);
#2 lore raw
Quoted 9 lines · Ananth N Mavinakayanahalli
Quoted 3 lines · Stephen Hemminger

Fix warning from missing cast, maybe a result of the x86 merge?

Thanks Stephen!

kprobes_32|64.c have already been merged to kprobes.c in the x86.git tree. A stack_addr() helper was added to deal with the differences here between 32 and 64 bit.

I'm pretty sure the x86 kprobes unification is headed for 2.6.25, so it will get fixed.

Harvey