All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: traps_misaligned: properly sign extend value in misaligned load handler
@ 2025-07-10 13:32 Andreas Schwab
  2025-07-10 19:05 ` Clément Léger
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andreas Schwab @ 2025-07-10 13:32 UTC (permalink / raw)
  To: linux-riscv; +Cc: damien.lemoal, anup, palmer

Add missing cast to signed long.

Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 arch/riscv/kernel/traps_misaligned.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c
index 93043924fe6c..f760e4fcc052 100644
--- a/arch/riscv/kernel/traps_misaligned.c
+++ b/arch/riscv/kernel/traps_misaligned.c
@@ -461,7 +461,7 @@ static int handle_scalar_misaligned_load(struct pt_regs *regs)
 	}
 
 	if (!fp)
-		SET_RD(insn, regs, val.data_ulong << shift >> shift);
+		SET_RD(insn, regs, (long)(val.data_ulong << shift) >> shift);
 	else if (len == 8)
 		set_f64_rd(insn, regs, val.data_u64);
 	else
-- 
2.50.0


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-08-12 21:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 13:32 [PATCH] riscv: traps_misaligned: properly sign extend value in misaligned load handler Andreas Schwab
2025-07-10 19:05 ` Clément Léger
2025-07-11  7:29 ` Alexandre Ghiti
2025-07-14  6:59   ` Andreas Schwab
2025-07-14  7:38   ` Andreas Schwab
2025-07-16 16:07 ` Palmer Dabbelt
2025-07-16 20:00 ` patchwork-bot+linux-riscv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.