diff -upN reference/arch/i386/kernel/traps.c current/arch/i386/kernel/traps.c
--- reference/arch/i386/kernel/traps.c	2004-04-30 13:02:17.000000000 -0700
+++ current/arch/i386/kernel/traps.c	2004-04-30 13:02:17.000000000 -0700
@@ -130,26 +130,31 @@ void breakpoint(void)
 
 static int kstack_depth_to_print = 24;
 
-#define valid_stack_ptr(task, p) \
-	((struct thread_info*)p > task->thread_info) && \
-	 !kstack_end((unsigned long*)p)
+static int valid_stack_ptr(struct task_struct *task, void *p)
+{
+	if (p <= (void *)task->thread_info)
+		return 0;
+	if (kstack_end(p))
+		return 0;
+	return 1;
+}
 
 #ifdef CONFIG_FRAME_POINTER
-void print_context_stack(struct task_struct *task, unsigned long * stack,
+void print_context_stack(struct task_struct *task, unsigned long *stack,
 			 unsigned long ebp)
 {
 	unsigned long addr;
 
-	while (valid_stack_ptr(task, ebp)) {
-		addr = *(unsigned long *) (ebp + 4);
+	while (valid_stack_ptr(task, (void *)ebp)) {
+		addr = *(unsigned long *)(ebp + 4);
 		printk(" [<%08lx>] ", addr);
 		print_symbol("%s", addr);
 		printk("\n");
-		ebp = *(unsigned long *) ebp;
+		ebp = *(unsigned long *)ebp;
 	}
 }
 #else
-void print_context_stack(struct task_struct *task, unsigned long * stack,
+void print_context_stack(struct task_struct *task, unsigned long *stack,
 			 unsigned long ebp)
 {
 	unsigned long addr;
@@ -186,7 +191,7 @@ void show_trace(struct task_struct *task
 
 	while (1) {
 		struct thread_info *context;
-		context = (struct thread_info*)
+		context = (struct thread_info *)
 			((unsigned long)stack & (~(THREAD_SIZE - 1)));
 		print_context_stack(task, stack, ebp);
 		stack = (unsigned long*)context->previous_esp;