Skip to content

Commit b8b4ead

Browse files
akpm00torvalds
authored andcommitted
drivers/input: eliminate INPUT_COMPAT_TEST macro
INPUT_COMPAT_TEST became much simpler after commit f4056b5 ("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>
1 parent bb29902 commit b8b4ead

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎drivers/input/input-compat.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
int input_event_from_user(const char __user *buffer,
1818
struct input_event *event)
1919
{
20-
if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) {
20+
if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) {
2121
struct input_event_compat compat_event;
2222

2323
if (copy_from_user(&compat_event, buffer,
@@ -41,7 +41,7 @@ int input_event_from_user(const char __user *buffer,
4141
int input_event_to_user(char __user *buffer,
4242
const struct input_event *event)
4343
{
44-
if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) {
44+
if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) {
4545
struct input_event_compat compat_event;
4646

4747
compat_event.time.tv_sec = event->time.tv_sec;
@@ -65,7 +65,7 @@ int input_event_to_user(char __user *buffer,
6565
int input_ff_effect_from_user(const char __user *buffer, size_t size,
6666
struct ff_effect *effect)
6767
{
68-
if (INPUT_COMPAT_TEST) {
68+
if (in_compat_syscall()) {
6969
struct ff_effect_compat *compat_effect;
7070

7171
if (size != sizeof(struct ff_effect_compat))

‎drivers/input/input-compat.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
#ifdef CONFIG_COMPAT
1919

20-
#define INPUT_COMPAT_TEST in_compat_syscall()
21-
2220
struct input_event_compat {
2321
struct compat_timeval time;
2422
__u16 type;
@@ -57,7 +55,7 @@ struct ff_effect_compat {
5755

5856
static inline size_t input_event_size(void)
5957
{
60-
return (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) ?
58+
return (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) ?
6159
sizeof(struct input_event_compat) : sizeof(struct input_event);
6260
}
6361

‎drivers/input/input.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ static int input_bits_to_string(char *buf, int buf_size,
10151015
{
10161016
int len = 0;
10171017

1018-
if (INPUT_COMPAT_TEST) {
1018+
if (in_compat_syscall()) {
10191019
u32 dword = bits >> 32;
10201020
if (dword || !skip_empty)
10211021
len += snprintf(buf, buf_size, "%x ", dword);

‎drivers/input/misc/uinput.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ struct uinput_ff_upload_compat {
664664
static int uinput_ff_upload_to_user(char __user *buffer,
665665
const struct uinput_ff_upload *ff_up)
666666
{
667-
if (INPUT_COMPAT_TEST) {
667+
if (in_compat_syscall()) {
668668
struct uinput_ff_upload_compat ff_up_compat;
669669

670670
ff_up_compat.request_id = ff_up->request_id;
@@ -695,7 +695,7 @@ static int uinput_ff_upload_to_user(char __user *buffer,
695695
static int uinput_ff_upload_from_user(const char __user *buffer,
696696
struct uinput_ff_upload *ff_up)
697697
{
698-
if (INPUT_COMPAT_TEST) {
698+
if (in_compat_syscall()) {
699699
struct uinput_ff_upload_compat ff_up_compat;
700700

701701
if (copy_from_user(&ff_up_compat, buffer,

0 commit comments

Comments
 (0)