Skip to content

Commit

Permalink
arch/sh/kernel/traps_64.c: use sign_extend64() for sign extension
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kepplinger <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: George Spelvin <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Yury Norov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
merge authored and torvalds committed Nov 7, 2015
1 parent 48e203e commit 06d8f81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/sh/kernel/cpu/sh5/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static int lookup_prev_stack_frame(unsigned long fp, unsigned long pc,

/* Sign extend */
regcache[dest] =
((((s64)(u64)op >> 10) & 0xffff) << 54) >> 54;
sign_extend64((((u64)op >> 10) & 0xffff), 9);
break;
case (0xd0 >> 2): /* addi */
case (0xd4 >> 2): /* addi.l */
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int generate_and_check_address(struct pt_regs *regs,
if (displacement_not_indexed) {
__s64 displacement;
displacement = (opcode >> 10) & 0x3ff;
displacement = ((displacement << 54) >> 54); /* sign extend */
displacement = sign_extend64(displacement, 9);
addr = (__u64)((__s64)base_address + (displacement << width_shift));
} else {
__u64 offset;
Expand Down

0 comments on commit 06d8f81

Please sign in to comment.