aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/jump_label.c
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2022-11-03 15:10:53 +0000
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2022-11-11 15:46:03 +0100
commit64ac0befe75bdfaffc396c2b4a0ed5ae6920eeee (patch)
treec1d0305020a86a7e9f2244c0c7ec26c5cce4cc1d /arch/mips/kernel/jump_label.c
parentmips: alchemy: gpio: Include the right header (diff)
downloadlinux-dev-64ac0befe75bdfaffc396c2b4a0ed5ae6920eeee.tar.xz
linux-dev-64ac0befe75bdfaffc396c2b4a0ed5ae6920eeee.zip
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: 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>
Diffstat (limited to '')
-rw-r--r--arch/mips/kernel/jump_label.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c
index 71a882c8c6eb..f7978d50a2ba 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;