powerpc: Simplify do_sigbus
authorAnton Blanchard <anton@samba.org>
Wed, 24 Sep 2014 06:59:56 +0000 (16:59 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 2 Oct 2014 07:15:09 +0000 (17:15 +1000)
Exit out early for a kernel fault, avoiding indenting of
most of the function.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/fault.c

index 51ab9e7e6c391b9497a08730a7b5e4c625c96304..abc8c816a3265af9e4d613fe1e810437bcc26715 100644 (file)
@@ -120,16 +120,16 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address)
 
        up_read(&current->mm->mmap_sem);
 
-       if (user_mode(regs)) {
-               current->thread.trap_nr = BUS_ADRERR;
-               info.si_signo = SIGBUS;
-               info.si_errno = 0;
-               info.si_code = BUS_ADRERR;
-               info.si_addr = (void __user *)address;
-               force_sig_info(SIGBUS, &info, current);
-               return MM_FAULT_RETURN;
-       }
-       return MM_FAULT_ERR(SIGBUS);
+       if (!user_mode(regs))
+               return MM_FAULT_ERR(SIGBUS);
+
+       current->thread.trap_nr = BUS_ADRERR;
+       info.si_signo = SIGBUS;
+       info.si_errno = 0;
+       info.si_code = BUS_ADRERR;
+       info.si_addr = (void __user *)address;
+       force_sig_info(SIGBUS, &info, current);
+       return MM_FAULT_RETURN;
 }
 
 static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)