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

From: guoren
Date: Tue Mar 25 2025 - 08:47:32 EST


From: "Guo Ren (Alibaba DAMO Academy)" <guoren@xxxxxxxxxx>

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@xxxxxxxxxx>
---
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