Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/input: eliminate INPUT_COMPAT_TEST macro

INPUT_COMPAT_TEST became much simpler after commit f4056b52845283
("input: redefine INPUT_COMPAT_TEST as in_compat_syscall()") so we can
cleanly eliminate it altogether.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
b8b4ead1 bb29902a

+7 -9
+3 -3
drivers/input/input-compat.c
··· 17 17 int input_event_from_user(const char __user *buffer, 18 18 struct input_event *event) 19 19 { 20 - if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) { 20 + if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { 21 21 struct input_event_compat compat_event; 22 22 23 23 if (copy_from_user(&compat_event, buffer, ··· 41 41 int input_event_to_user(char __user *buffer, 42 42 const struct input_event *event) 43 43 { 44 - if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) { 44 + if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { 45 45 struct input_event_compat compat_event; 46 46 47 47 compat_event.time.tv_sec = event->time.tv_sec; ··· 65 65 int input_ff_effect_from_user(const char __user *buffer, size_t size, 66 66 struct ff_effect *effect) 67 67 { 68 - if (INPUT_COMPAT_TEST) { 68 + if (in_compat_syscall()) { 69 69 struct ff_effect_compat *compat_effect; 70 70 71 71 if (size != sizeof(struct ff_effect_compat))
+1 -3
drivers/input/input-compat.h
··· 17 17 18 18 #ifdef CONFIG_COMPAT 19 19 20 - #define INPUT_COMPAT_TEST in_compat_syscall() 21 - 22 20 struct input_event_compat { 23 21 struct compat_timeval time; 24 22 __u16 type; ··· 55 57 56 58 static inline size_t input_event_size(void) 57 59 { 58 - return (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) ? 60 + return (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) ? 59 61 sizeof(struct input_event_compat) : sizeof(struct input_event); 60 62 } 61 63
+1 -1
drivers/input/input.c
··· 1015 1015 { 1016 1016 int len = 0; 1017 1017 1018 - if (INPUT_COMPAT_TEST) { 1018 + if (in_compat_syscall()) { 1019 1019 u32 dword = bits >> 32; 1020 1020 if (dword || !skip_empty) 1021 1021 len += snprintf(buf, buf_size, "%x ", dword);
+2 -2
drivers/input/misc/uinput.c
··· 664 664 static int uinput_ff_upload_to_user(char __user *buffer, 665 665 const struct uinput_ff_upload *ff_up) 666 666 { 667 - if (INPUT_COMPAT_TEST) { 667 + if (in_compat_syscall()) { 668 668 struct uinput_ff_upload_compat ff_up_compat; 669 669 670 670 ff_up_compat.request_id = ff_up->request_id; ··· 695 695 static int uinput_ff_upload_from_user(const char __user *buffer, 696 696 struct uinput_ff_upload *ff_up) 697 697 { 698 - if (INPUT_COMPAT_TEST) { 698 + if (in_compat_syscall()) { 699 699 struct uinput_ff_upload_compat ff_up_compat; 700 700 701 701 if (copy_from_user(&ff_up_compat, buffer,