diff mbox

[v2,14/16] input: Redefine INPUT_COMPAT_TEST as in_compat_syscall()

Message ID 64480084bc652d5fa91bf5cd4be979e2f1e4cf11.1453759363.git.luto@kernel.org (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Andy Lutomirski Jan. 25, 2016, 10:24 p.m. UTC
The input compat code should work like all other compat code: for
32-bit syscalls, use the 32-bit ABI and for 64-bit syscalls, use the
64-bit ABI.  We have a helper for that (in_compat_syscall()): just
use it.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/input/input-compat.h | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

Dmitry Torokhov Jan. 27, 2016, 7:17 p.m. UTC | #1
Hi Andy,

On Mon, Jan 25, 2016 at 2:24 PM, Andy Lutomirski <luto@kernel.org> wrote:
> The input compat code should work like all other compat code: for
> 32-bit syscalls, use the 32-bit ABI and for 64-bit syscalls, use the
> 64-bit ABI.  We have a helper for that (in_compat_syscall()): just
> use it.
>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
>  drivers/input/input-compat.h | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/input/input-compat.h b/drivers/input/input-compat.h
> index 148f66fe3205..0f25878d5fa2 100644
> --- a/drivers/input/input-compat.h
> +++ b/drivers/input/input-compat.h
> @@ -17,17 +17,7 @@
>
>  #ifdef CONFIG_COMPAT
>
> -/* Note to the author of this code: did it ever occur to
> -   you why the ifdefs are needed? Think about it again. -AK */
> -#if defined(CONFIG_X86_64) || defined(CONFIG_TILE)
> -#  define INPUT_COMPAT_TEST is_compat_task()
> -#elif defined(CONFIG_S390)
> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_31BIT)
> -#elif defined(CONFIG_MIPS)
> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT_ADDR)
> -#else
> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT)
> -#endif
> +#define INPUT_COMPAT_TEST in_compat_syscall()
>


If we now have function that works on all arches I'd prefer if we used
it directly instead of continuing using INPUT_COMPAT_TEST.

Thanks.
Andy Lutomirski Jan. 27, 2016, 8:29 p.m. UTC | #2
On Wed, Jan 27, 2016 at 11:17 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Andy,
>
> On Mon, Jan 25, 2016 at 2:24 PM, Andy Lutomirski <luto@kernel.org> wrote:
>> The input compat code should work like all other compat code: for
>> 32-bit syscalls, use the 32-bit ABI and for 64-bit syscalls, use the
>> 64-bit ABI.  We have a helper for that (in_compat_syscall()): just
>> use it.
>>
>> Signed-off-by: Andy Lutomirski <luto@kernel.org>
>> ---
>>  drivers/input/input-compat.h | 12 +-----------
>>  1 file changed, 1 insertion(+), 11 deletions(-)
>>
>> diff --git a/drivers/input/input-compat.h b/drivers/input/input-compat.h
>> index 148f66fe3205..0f25878d5fa2 100644
>> --- a/drivers/input/input-compat.h
>> +++ b/drivers/input/input-compat.h
>> @@ -17,17 +17,7 @@
>>
>>  #ifdef CONFIG_COMPAT
>>
>> -/* Note to the author of this code: did it ever occur to
>> -   you why the ifdefs are needed? Think about it again. -AK */
>> -#if defined(CONFIG_X86_64) || defined(CONFIG_TILE)
>> -#  define INPUT_COMPAT_TEST is_compat_task()
>> -#elif defined(CONFIG_S390)
>> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_31BIT)
>> -#elif defined(CONFIG_MIPS)
>> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT_ADDR)
>> -#else
>> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT)
>> -#endif
>> +#define INPUT_COMPAT_TEST in_compat_syscall()
>>
>
>
> If we now have function that works on all arches I'd prefer if we used
> it directly instead of continuing using INPUT_COMPAT_TEST.

I'll write a followup patch for that if you don't beat me to it.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov Jan. 27, 2016, 9:06 p.m. UTC | #3
On Wed, Jan 27, 2016 at 12:29:14PM -0800, Andy Lutomirski wrote:
> On Wed, Jan 27, 2016 at 11:17 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > Hi Andy,
> >
> > On Mon, Jan 25, 2016 at 2:24 PM, Andy Lutomirski <luto@kernel.org> wrote:
> >> The input compat code should work like all other compat code: for
> >> 32-bit syscalls, use the 32-bit ABI and for 64-bit syscalls, use the
> >> 64-bit ABI.  We have a helper for that (in_compat_syscall()): just
> >> use it.
> >>
> >> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> >> ---
> >>  drivers/input/input-compat.h | 12 +-----------
> >>  1 file changed, 1 insertion(+), 11 deletions(-)
> >>
> >> diff --git a/drivers/input/input-compat.h b/drivers/input/input-compat.h
> >> index 148f66fe3205..0f25878d5fa2 100644
> >> --- a/drivers/input/input-compat.h
> >> +++ b/drivers/input/input-compat.h
> >> @@ -17,17 +17,7 @@
> >>
> >>  #ifdef CONFIG_COMPAT
> >>
> >> -/* Note to the author of this code: did it ever occur to
> >> -   you why the ifdefs are needed? Think about it again. -AK */
> >> -#if defined(CONFIG_X86_64) || defined(CONFIG_TILE)
> >> -#  define INPUT_COMPAT_TEST is_compat_task()
> >> -#elif defined(CONFIG_S390)
> >> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_31BIT)
> >> -#elif defined(CONFIG_MIPS)
> >> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT_ADDR)
> >> -#else
> >> -#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT)
> >> -#endif
> >> +#define INPUT_COMPAT_TEST in_compat_syscall()
> >>
> >
> >
> > If we now have function that works on all arches I'd prefer if we used
> > it directly instead of continuing using INPUT_COMPAT_TEST.
> 
> I'll write a followup patch for that if you don't beat me to it.

I promise I wont ;)
diff mbox

Patch

diff --git a/drivers/input/input-compat.h b/drivers/input/input-compat.h
index 148f66fe3205..0f25878d5fa2 100644
--- a/drivers/input/input-compat.h
+++ b/drivers/input/input-compat.h
@@ -17,17 +17,7 @@ 
 
 #ifdef CONFIG_COMPAT
 
-/* Note to the author of this code: did it ever occur to
-   you why the ifdefs are needed? Think about it again. -AK */
-#if defined(CONFIG_X86_64) || defined(CONFIG_TILE)
-#  define INPUT_COMPAT_TEST is_compat_task()
-#elif defined(CONFIG_S390)
-#  define INPUT_COMPAT_TEST test_thread_flag(TIF_31BIT)
-#elif defined(CONFIG_MIPS)
-#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT_ADDR)
-#else
-#  define INPUT_COMPAT_TEST test_thread_flag(TIF_32BIT)
-#endif
+#define INPUT_COMPAT_TEST in_compat_syscall()
 
 struct input_event_compat {
 	struct compat_timeval time;