aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2012-12-12 16:52:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 20:38:34 -0500
commitc2d23f919bafcbc2259f5257d9a7d729802f0e3a (patch)
treea3b7e4fba1636183fb16d5564a1fe45d5e297a06 /arch/sh
parent0fa84a4bfa2aac8c04d45351b40765d61e1fd20d (diff)
mm, oom: remove statically defined arch functions of same name
out_of_memory() is a globally defined function to call the oom killer. x86, sh, and powerpc all use a function of the same name within file scope in their respective fault.c unnecessarily. Inline the functions into the pagefault handlers to clean the code up. Signed-off-by: David Rientjes <rientjes@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Paul Mundt <lethal@linux-sh.org> Reviewed-by: Michal Hocko <mhocko@suse.cz> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/mm/fault.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index cbbdcad8fcb3..1f49c28affa9 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -301,17 +301,6 @@ bad_area_access_error(struct pt_regs *regs, unsigned long error_code,
301 __bad_area(regs, error_code, address, SEGV_ACCERR); 301 __bad_area(regs, error_code, address, SEGV_ACCERR);
302} 302}
303 303
304static void out_of_memory(void)
305{
306 /*
307 * We ran out of memory, call the OOM killer, and return the userspace
308 * (which will retry the fault, or kill us if we got oom-killed):
309 */
310 up_read(&current->mm->mmap_sem);
311
312 pagefault_out_of_memory();
313}
314
315static void 304static void
316do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address) 305do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address)
317{ 306{
@@ -353,8 +342,14 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
353 no_context(regs, error_code, address); 342 no_context(regs, error_code, address);
354 return 1; 343 return 1;
355 } 344 }
345 up_read(&current->mm->mmap_sem);
356 346
357 out_of_memory(); 347 /*
348 * We ran out of memory, call the OOM killer, and return the
349 * userspace (which will retry the fault, or kill us if we got
350 * oom-killed):
351 */
352 pagefault_out_of_memory();
358 } else { 353 } else {
359 if (fault & VM_FAULT_SIGBUS) 354 if (fault & VM_FAULT_SIGBUS)
360 do_sigbus(regs, error_code, address); 355 do_sigbus(regs, error_code, address);