From: Vincent Hanquez Use the user_mode macro where it's possible. Signed-off-by: Vincent Hanquez Cc: Ian Pratt Signed-off-by: Andrew Morton --- arch/i386/kernel/process.c | 2 +- arch/i386/kernel/signal.c | 2 +- arch/i386/kernel/traps.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff -puN arch/i386/kernel/process.c~xen-x86-use-more-usermode-macro arch/i386/kernel/process.c --- 25/arch/i386/kernel/process.c~xen-x86-use-more-usermode-macro 2005-05-11 21:14:54.000000000 -0700 +++ 25-akpm/arch/i386/kernel/process.c 2005-05-11 21:14:54.000000000 -0700 @@ -262,7 +262,7 @@ void show_regs(struct pt_regs * regs) printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); print_symbol("EIP is at %s\n", regs->eip); - if (regs->xcs & 3) + if (user_mode(regs)) printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); printk(" EFLAGS: %08lx %s (%s)\n", regs->eflags, print_tainted(), system_utsname.release); diff -puN arch/i386/kernel/signal.c~xen-x86-use-more-usermode-macro arch/i386/kernel/signal.c --- 25/arch/i386/kernel/signal.c~xen-x86-use-more-usermode-macro 2005-05-11 21:14:54.000000000 -0700 +++ 25-akpm/arch/i386/kernel/signal.c 2005-05-11 21:14:54.000000000 -0700 @@ -605,7 +605,7 @@ int fastcall do_signal(struct pt_regs *r * kernel mode. Just return without doing anything * if so. */ - if ((regs->xcs & 3) != 3) + if (!user_mode(regs)) return 1; if (current->flags & PF_FREEZE) { diff -puN arch/i386/kernel/traps.c~xen-x86-use-more-usermode-macro arch/i386/kernel/traps.c --- 25/arch/i386/kernel/traps.c~xen-x86-use-more-usermode-macro 2005-05-11 21:14:54.000000000 -0700 +++ 25-akpm/arch/i386/kernel/traps.c 2005-05-11 21:14:54.000000000 -0700 @@ -209,7 +209,7 @@ void show_registers(struct pt_regs *regs esp = (unsigned long) (®s->esp); ss = __KERNEL_DS; - if (regs->xcs & 3) { + if (user_mode(regs)) { in_kernel = 0; esp = regs->esp; ss = regs->xss & 0xffff; @@ -265,7 +265,7 @@ static void handle_BUG(struct pt_regs *r char c; unsigned long eip; - if (regs->xcs & 3) + if (user_mode(regs)) goto no_bug; /* Not in kernel */ eip = regs->eip; @@ -353,7 +353,7 @@ void die(const char * str, struct pt_reg static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) { - if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs)) + if (!user_mode_vm(regs)) die(str, regs, err); } @@ -366,7 +366,7 @@ static void do_trap(int trapnr, int sign goto trap_signal; } - if (!(regs->xcs & 3)) + if (!user_mode(regs)) goto kernel_trap; trap_signal: { @@ -488,7 +488,7 @@ fastcall void do_general_protection(stru if (regs->eflags & VM_MASK) goto gp_in_vm86; - if (!(regs->xcs & 3)) + if (!user_mode(regs)) goto gp_in_kernel; current->thread.error_code = error_code; @@ -713,7 +713,7 @@ fastcall void do_debug(struct pt_regs * * check for kernel mode by just checking the CPL * of CS. */ - if ((regs->xcs & 3) == 0) + if (!user_mode(regs)) goto clear_TF_reenable; } _