diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-07-01 21:29:15 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-08-21 12:00:58 -0700 |
| commit | 2ec25d34169580922fc6e398fb0cb2591d19349c (patch) | |
| tree | 340faee1e972be6645ded725a47905264504c88c /drivers/input/input.c | |
| parent | 4b051897df2375414587a245ecb9bb1a4d26b3b8 (diff) | |
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 <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/input.c')
| -rw-r--r-- | drivers/input/input.c | 35 |
1 files changed, 0 insertions, 35 deletions
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; |
