linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc: Simplify do_sigbus
@ 2014-09-24  6:59 Anton Blanchard
  2014-09-24  6:59 ` [PATCH 2/3] powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler Anton Blanchard
  2014-09-24  6:59 ` [PATCH 3/3] powerpc: Fill in si_addr_lsb siginfo field Anton Blanchard
  0 siblings, 2 replies; 3+ messages in thread
From: Anton Blanchard @ 2014-09-24  6:59 UTC (permalink / raw)
  To: benh, paulus, mpe, amodra, torvalds, sfr; +Cc: linuxppc-dev

Exit out early for a kernel fault, avoiding indenting of
most of the function.

Signed-off-by: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/mm/fault.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 51ab9e7..abc8c81 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -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)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-24  7:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24  6:59 [PATCH 1/3] powerpc: Simplify do_sigbus Anton Blanchard
2014-09-24  6:59 ` [PATCH 2/3] powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler Anton Blanchard
2014-09-24  6:59 ` [PATCH 3/3] powerpc: Fill in si_addr_lsb siginfo field Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).