Skip to content

Commit 2e74694

Browse files
deepa-hubdtor
authored andcommitted
Input: input_event - provide override for sparc64
The usec part of the timeval is defined as __kernel_suseconds_t tv_usec; /* microseconds */ Arnd noticed that sparc64 is the only architecture that defines __kernel_suseconds_t as int rather than long. This breaks the current y2038 fix for kernel as we only access and define the timeval struct for non-kernel use cases. But, this was hidden by an another typo in the use of __KERNEL__ qualifier. Fix the typo, and provide an override for sparc64. Fixes: 152194f ("Input: extend usable life of event timestamps to 2106 on 32 bit systems") Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Deepa Dinamani <[email protected]> Cc: [email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 592b15b commit 2e74694

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/uapi/linux/input.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@
2626
*/
2727

2828
struct input_event {
29-
#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL)
29+
#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL__)
3030
struct timeval time;
3131
#define input_event_sec time.tv_sec
3232
#define input_event_usec time.tv_usec
3333
#else
3434
__kernel_ulong_t __sec;
35+
#ifdef CONFIG_SPARC64
36+
unsigned int __usec;
37+
#else
3538
__kernel_ulong_t __usec;
39+
#endif
3640
#define input_event_sec __sec
3741
#define input_event_usec __usec
3842
#endif

0 commit comments

Comments
 (0)