diff mbox series

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

Message ID 20250325121624.523258-28-guoren@kernel.org (mailing list archive)
State New
Headers show
Series rv64ilp32_abi: Build CONFIG_64BIT kernel-self with ILP32 ABI | expand

Commit Message

Guo Ren March 25, 2025, 12:16 p.m. UTC
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 mbox series

Patch

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);