summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2024-02-16 11:10:36 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2024-02-22 21:55:33 +1100
commitd5835fb60bad641dbae64fe30c02f10857bf4647 (patch)
tree833480077dbbc7ce3f42ccbde962dbe071703ce1 /arch/powerpc/xmon
parent9e00743aba832f3f30ecb017d3345baf1f372140 (diff)
downloadlinux-stable-d5835fb60bad641dbae64fe30c02f10857bf4647.tar.gz
linux-stable-d5835fb60bad641dbae64fe30c02f10857bf4647.tar.bz2
linux-stable-d5835fb60bad641dbae64fe30c02f10857bf4647.zip
powerpc: Use user_mode() macro when possible
There is a nice macro to check user mode. Use it instead of open coding anding with MSR_PR to increase readability and avoid having to comment what that anding is for. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/fbf74887dcf1f1ba9e1680fc3247cbb581b00662.1708078228.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/xmon')
-rw-r--r--arch/powerpc/xmon/xmon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index f413c220165c..c85fa3f0dd3b 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1818,8 +1818,8 @@ static void print_bug_trap(struct pt_regs *regs)
const struct bug_entry *bug;
unsigned long addr;
- if (regs->msr & MSR_PR)
- return; /* not in kernel */
+ if (user_mode(regs))
+ return;
addr = regs->nip; /* address of trap instruction */
if (!is_kernel_addr(addr))
return;