Skip to content

Commit e9df614

Browse files
hcahcaVasily Gorbik
authored andcommitted
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 <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 9ef496d commit e9df614

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/s390/kernel/traps.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,23 @@ static void translation_specification_exception(struct pt_regs *regs)
154154

155155
static void illegal_op(struct pt_regs *regs)
156156
{
157-
__u8 opcode[6];
158-
__u16 __user *location;
159157
int is_uprobe_insn = 0;
158+
u16 __user *location;
160159
int signal = 0;
160+
u16 opcode;
161161

162162
location = get_trap_ip(regs);
163163

164164
if (user_mode(regs)) {
165-
if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
165+
if (get_user(opcode, location))
166166
return;
167-
if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
167+
if (opcode == S390_BREAKPOINT_U16) {
168168
if (current->ptrace)
169169
force_sig_fault(SIGTRAP, TRAP_BRKPT, location);
170170
else
171171
signal = SIGILL;
172172
#ifdef CONFIG_UPROBES
173-
} else if (*((__u16 *) opcode) == UPROBE_SWBP_INSN) {
173+
} else if (opcode == UPROBE_SWBP_INSN) {
174174
is_uprobe_insn = 1;
175175
#endif
176176
} else

0 commit comments

Comments
 (0)