diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2022-11-03 18:10:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-16 11:57:15 +0300 |
commit | 4631cb040645eff4626d02a2a318863a3e53e2af (patch) | |
tree | 36b0eb82643470525b7601bf3bff22bd8a2cb1f7 /arch/mips | |
parent | 475fd3991a0d98e7b43b51e64b1eb92d0a885430 (diff) | |
download | linux-4631cb040645eff4626d02a2a318863a3e53e2af.tar.xz |
MIPS: jump_label: Fix compat branch range check
commit 64ac0befe75bdfaffc396c2b4a0ed5ae6920eeee upstream.
Cast upper bound of branch range to long to do signed compare,
avoid negative offset trigger this warning.
Fixes: 9b6584e35f40 ("MIPS: jump_label: Use compact branches for >= r6")
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/jump_label.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c index 662c8db9f45b..9f5b1247b4ba 100644 --- a/arch/mips/kernel/jump_label.c +++ b/arch/mips/kernel/jump_label.c @@ -56,7 +56,7 @@ void arch_jump_label_transform(struct jump_entry *e, * The branch offset must fit in the instruction's 26 * bit field. */ - WARN_ON((offset >= BIT(25)) || + WARN_ON((offset >= (long)BIT(25)) || (offset < -(long)BIT(25))); insn.j_format.opcode = bc6_op; |