aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-07-27 04:31:12 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-07-30 05:03:12 -0400
commit7d25617597ff8dcfe4d0e1d0ac9214e7cc7ded92 (patch)
tree5195733687b3194e053be0687137f6f6b05472e0 /arch/s390/mm
parent37fe1d73a449bdebc4908d04e518f5852d6c453b (diff)
s390: make use of user_mode() macro where possible
We use the user_mode() helper already at several places but also have the open coded variant at other places. Convert the code to always use the helper function. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/fault.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 5bddbe4895d5..6c013f544146 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -220,7 +220,7 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault)
220 case VM_FAULT_BADACCESS: 220 case VM_FAULT_BADACCESS:
221 case VM_FAULT_BADMAP: 221 case VM_FAULT_BADMAP:
222 /* Bad memory access. Check if it is kernel or user space. */ 222 /* Bad memory access. Check if it is kernel or user space. */
223 if (regs->psw.mask & PSW_MASK_PSTATE) { 223 if (user_mode(regs)) {
224 /* User mode accesses just cause a SIGSEGV */ 224 /* User mode accesses just cause a SIGSEGV */
225 si_code = (fault == VM_FAULT_BADMAP) ? 225 si_code = (fault == VM_FAULT_BADMAP) ?
226 SEGV_MAPERR : SEGV_ACCERR; 226 SEGV_MAPERR : SEGV_ACCERR;
@@ -236,13 +236,13 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault)
236 break; 236 break;
237 default: /* fault & VM_FAULT_ERROR */ 237 default: /* fault & VM_FAULT_ERROR */
238 if (fault & VM_FAULT_OOM) { 238 if (fault & VM_FAULT_OOM) {
239 if (!(regs->psw.mask & PSW_MASK_PSTATE)) 239 if (!user_mode(regs))
240 do_no_context(regs); 240 do_no_context(regs);
241 else 241 else
242 pagefault_out_of_memory(); 242 pagefault_out_of_memory();
243 } else if (fault & VM_FAULT_SIGBUS) { 243 } else if (fault & VM_FAULT_SIGBUS) {
244 /* Kernel mode? Handle exceptions or die */ 244 /* Kernel mode? Handle exceptions or die */
245 if (!(regs->psw.mask & PSW_MASK_PSTATE)) 245 if (!user_mode(regs))
246 do_no_context(regs); 246 do_no_context(regs);
247 else 247 else
248 do_sigbus(regs); 248 do_sigbus(regs);
@@ -436,7 +436,7 @@ void __kprobes do_asce_exception(struct pt_regs *regs)
436 } 436 }
437 437
438 /* User mode accesses just cause a SIGSEGV */ 438 /* User mode accesses just cause a SIGSEGV */
439 if (regs->psw.mask & PSW_MASK_PSTATE) { 439 if (user_mode(regs)) {
440 do_sigsegv(regs, SEGV_MAPERR); 440 do_sigsegv(regs, SEGV_MAPERR);
441 return; 441 return;
442 } 442 }