diff options
author | 2025-02-26 11:03:04 +0100 | |
---|---|---|
committer | 2025-03-04 17:34:03 +0100 | |
commit | e9df614dad8ebe43ed15bef3b18789319a73e0f6 (patch) | |
tree | 69bd1b427f84dae79cd0e437f525670d785eef49 | |
parent | s390/boot: Convert __diag308() to extable (diff) | |
download | wireguard-linux-e9df614dad8ebe43ed15bef3b18789319a73e0f6.tar.xz wireguard-linux-e9df614dad8ebe43ed15bef3b18789319a73e0f6.zip |
s390/traps: Cleanup get_user() handling in illegal_op()
The usage of get_user() in illegal_op() is quite unusual. Make the code
more readable and get rid of unnecessary casts. The generated code is
identical before/after this change.
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r-- | arch/s390/kernel/traps.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 6db2c1466531..478c5871aefa 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -154,23 +154,23 @@ static void translation_specification_exception(struct pt_regs *regs) static void illegal_op(struct pt_regs *regs) { - __u8 opcode[6]; - __u16 __user *location; int is_uprobe_insn = 0; + u16 __user *location; int signal = 0; + u16 opcode; location = get_trap_ip(regs); if (user_mode(regs)) { - if (get_user(*((__u16 *) opcode), (__u16 __user *) location)) + if (get_user(opcode, location)) return; - if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { + if (opcode == S390_BREAKPOINT_U16) { if (current->ptrace) force_sig_fault(SIGTRAP, TRAP_BRKPT, location); else signal = SIGILL; #ifdef CONFIG_UPROBES - } else if (*((__u16 *) opcode) == UPROBE_SWBP_INSN) { + } else if (opcode == UPROBE_SWBP_INSN) { is_uprobe_insn = 1; #endif } else |