diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-07-27 10:31:12 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-07-30 11:03:12 +0200 |
commit | 7d25617597ff8dcfe4d0e1d0ac9214e7cc7ded92 (patch) | |
tree | 5195733687b3194e053be0687137f6f6b05472e0 /arch/s390/mm/fault.c | |
parent | 37fe1d73a449bdebc4908d04e518f5852d6c453b (diff) | |
download | op-kernel-dev-7d25617597ff8dcfe4d0e1d0ac9214e7cc7ded92.zip op-kernel-dev-7d25617597ff8dcfe4d0e1d0ac9214e7cc7ded92.tar.gz |
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/fault.c')
-rw-r--r-- | arch/s390/mm/fault.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 5bddbe4..6c013f5 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) case VM_FAULT_BADACCESS: case VM_FAULT_BADMAP: /* Bad memory access. Check if it is kernel or user space. */ - if (regs->psw.mask & PSW_MASK_PSTATE) { + if (user_mode(regs)) { /* User mode accesses just cause a SIGSEGV */ si_code = (fault == VM_FAULT_BADMAP) ? SEGV_MAPERR : SEGV_ACCERR; @@ -236,13 +236,13 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault) break; default: /* fault & VM_FAULT_ERROR */ if (fault & VM_FAULT_OOM) { - if (!(regs->psw.mask & PSW_MASK_PSTATE)) + if (!user_mode(regs)) do_no_context(regs); else pagefault_out_of_memory(); } else if (fault & VM_FAULT_SIGBUS) { /* Kernel mode? Handle exceptions or die */ - if (!(regs->psw.mask & PSW_MASK_PSTATE)) + if (!user_mode(regs)) do_no_context(regs); else do_sigbus(regs); @@ -436,7 +436,7 @@ void __kprobes do_asce_exception(struct pt_regs *regs) } /* User mode accesses just cause a SIGSEGV */ - if (regs->psw.mask & PSW_MASK_PSTATE) { + if (user_mode(regs)) { do_sigsegv(regs, SEGV_MAPERR); return; } |