Thread (63 messages) 63 messages, 10 authors, 2025-03-27
STALE449d

[RFC PATCH V3 27/43] rv64ilp32_abi: input: Adapt BITS_PER_LONG to dword

From: guoren@kernel.org
Date: 2025-03-25 12:23:14
Also in: bpf, kvm, kvm-riscv, linux-arch, linux-btrfs, linux-crypto, linux-fsdevel, linux-input, linux-media, linux-mm, linux-nfs, linux-perf-users, linux-riscv, linux-sctp, linux-serial, linux-usb, lkml, netdev, netfilter-devel
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

From: "Guo Ren (Alibaba DAMO Academy)" <guoren@kernel.org>

The RV64ILP32 ABI linux kernel is based on CONFIG_64BIT, but
BITS_PER_LONG is 32. So, adapt bits to dword with BITS_PER_LONG.

Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
---
 drivers/input/input.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index c9e3ac64bcd0..7af5e8c66f25 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1006,7 +1006,11 @@ static int input_bits_to_string(char *buf, int buf_size,
 	int len = 0;
 
 	if (in_compat_syscall()) {
+#if BITS_PER_LONG == 64
 		u32 dword = bits >> 32;
+#else
+		u32 dword = bits;
+#endif
 		if (dword || !skip_empty)
 			len += snprintf(buf, buf_size, "%x ", dword);
 
-- 
2.40.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help