From 2ec25d34169580922fc6e398fb0cb2591d19349c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 1 Jul 2025 21:29:15 -0700 Subject: Input: move input_bits_to_string() to input-compat.c The input_bits_to_string() function has special handling for compat tasks, formatting the output as a sequence of 32-bit hex values. To better isolate compatibility-related code, move it from drivers/input/input.c to drivers/input/input-compat.c. No functional change intended. Signed-off-by: Dmitry Torokhov --- drivers/input/input.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'drivers/input/input.c') diff --git a/drivers/input/input.c b/drivers/input/input.c index 1da41324362b..9ec817acfeb1 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -998,41 +998,6 @@ static int input_attach_handler(struct input_dev *dev, struct input_handler *han return error; } -#ifdef CONFIG_COMPAT - -static int input_bits_to_string(char *buf, int buf_size, - unsigned long bits, bool skip_empty) -{ - int len = 0; - - if (in_compat_syscall()) { - u32 dword = bits >> 32; - if (dword || !skip_empty) - len += snprintf(buf, buf_size, "%x ", dword); - - dword = bits & 0xffffffffUL; - if (dword || !skip_empty || len) - len += snprintf(buf + len, max(buf_size - len, 0), - "%x", dword); - } else { - if (bits || !skip_empty) - len += snprintf(buf, buf_size, "%lx", bits); - } - - return len; -} - -#else /* !CONFIG_COMPAT */ - -static int input_bits_to_string(char *buf, int buf_size, - unsigned long bits, bool skip_empty) -{ - return bits || !skip_empty ? - snprintf(buf, buf_size, "%lx", bits) : 0; -} - -#endif - #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_bus_input_dir; -- cgit v1.2.3 From df595059d54383c42607b59f1f9ea74dade280fe Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 6 Aug 2025 11:16:51 -0700 Subject: Input: include export.h in modules using EXPORT_SYMBOL*() A number of modules in the input subsystem use EXPORT_SYMBOL() and friends without explicitly including the corresponding header . While the build currently succeeds due to this header being pulled in transitively, this is not guaranteed to be the case in the future. Let's add the explicit include to make the dependencies clear and prevent future build breakage. Signed-off-by: Dmitry Torokhov --- drivers/input/input.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/input/input.c') diff --git a/drivers/input/input.c b/drivers/input/input.c index 9ec817acfeb1..a500e1e276c2 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) KBUILD_BASENAME ": " fmt +#include #include #include #include -- cgit v1.2.3