Skip to content

Commit 64ac0be

Browse files
FlyGoattsbogend
authored andcommitted
MIPS: jump_label: Fix compat branch range check
Cast upper bound of branch range to long to do signed compare, avoid negative offset trigger this warning. Fixes: 9b6584e ("MIPS: jump_label: Use compact branches for >= r6") Signed-off-by: Jiaxun Yang <[email protected]> Cc: [email protected] Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 2a29615 commit 64ac0be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/kernel/jump_label.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e,
5656
* The branch offset must fit in the instruction's 26
5757
* bit field.
5858
*/
59-
WARN_ON((offset >= BIT(25)) ||
59+
WARN_ON((offset >= (long)BIT(25)) ||
6060
(offset < -(long)BIT(25)));
6161

6262
insn.j_format.opcode = bc6_op;

0 commit comments

Comments
 (0)