@@ -55,7 +55,7 @@ static inline bool isalarm(struct timerfd_ctx *ctx)
55
55
/*
56
56
* This gets called when the timer event triggers. We set the "expired"
57
57
* flag, but we do not re-arm the timer (in case it's necessary,
58
- * tintv.tv64 != 0) until the timer is accessed.
58
+ * tintv != 0) until the timer is accessed.
59
59
*/
60
60
static void timerfd_triggered (struct timerfd_ctx * ctx )
61
61
{
@@ -93,7 +93,7 @@ static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm,
93
93
*/
94
94
void timerfd_clock_was_set (void )
95
95
{
96
- ktime_t moffs = ktime_mono_to_real (( ktime_t ){ . tv64 = 0 } );
96
+ ktime_t moffs = ktime_mono_to_real (0 );
97
97
struct timerfd_ctx * ctx ;
98
98
unsigned long flags ;
99
99
@@ -102,8 +102,8 @@ void timerfd_clock_was_set(void)
102
102
if (!ctx -> might_cancel )
103
103
continue ;
104
104
spin_lock_irqsave (& ctx -> wqh .lock , flags );
105
- if (ctx -> moffs . tv64 != moffs . tv64 ) {
106
- ctx -> moffs . tv64 = KTIME_MAX ;
105
+ if (ctx -> moffs != moffs ) {
106
+ ctx -> moffs = KTIME_MAX ;
107
107
ctx -> ticks ++ ;
108
108
wake_up_locked (& ctx -> wqh );
109
109
}
@@ -124,9 +124,9 @@ static void timerfd_remove_cancel(struct timerfd_ctx *ctx)
124
124
125
125
static bool timerfd_canceled (struct timerfd_ctx * ctx )
126
126
{
127
- if (!ctx -> might_cancel || ctx -> moffs . tv64 != KTIME_MAX )
127
+ if (!ctx -> might_cancel || ctx -> moffs != KTIME_MAX )
128
128
return false;
129
- ctx -> moffs = ktime_mono_to_real (( ktime_t ){ . tv64 = 0 } );
129
+ ctx -> moffs = ktime_mono_to_real (0 );
130
130
return true;
131
131
}
132
132
@@ -155,7 +155,7 @@ static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
155
155
else
156
156
remaining = hrtimer_expires_remaining_adjusted (& ctx -> t .tmr );
157
157
158
- return remaining . tv64 < 0 ? ktime_set (0 , 0 ): remaining ;
158
+ return remaining < 0 ? ktime_set (0 , 0 ): remaining ;
159
159
}
160
160
161
161
static int timerfd_setup (struct timerfd_ctx * ctx , int flags ,
@@ -184,7 +184,7 @@ static int timerfd_setup(struct timerfd_ctx *ctx, int flags,
184
184
ctx -> t .tmr .function = timerfd_tmrproc ;
185
185
}
186
186
187
- if (texp . tv64 != 0 ) {
187
+ if (texp != 0 ) {
188
188
if (isalarm (ctx )) {
189
189
if (flags & TFD_TIMER_ABSTIME )
190
190
alarm_start (& ctx -> t .alarm , texp );
@@ -261,9 +261,9 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
261
261
if (ctx -> ticks ) {
262
262
ticks = ctx -> ticks ;
263
263
264
- if (ctx -> expired && ctx -> tintv . tv64 ) {
264
+ if (ctx -> expired && ctx -> tintv ) {
265
265
/*
266
- * If tintv.tv64 != 0, this is a periodic timer that
266
+ * If tintv != 0, this is a periodic timer that
267
267
* needs to be re-armed. We avoid doing it in the timer
268
268
* callback to avoid DoS attacks specifying a very
269
269
* short timer period.
@@ -410,7 +410,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
410
410
else
411
411
hrtimer_init (& ctx -> t .tmr , clockid , HRTIMER_MODE_ABS );
412
412
413
- ctx -> moffs = ktime_mono_to_real (( ktime_t ){ . tv64 = 0 } );
413
+ ctx -> moffs = ktime_mono_to_real (0 );
414
414
415
415
ufd = anon_inode_getfd ("[timerfd]" , & timerfd_fops , ctx ,
416
416
O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS ));
@@ -469,7 +469,7 @@ static int do_timerfd_settime(int ufd, int flags,
469
469
* We do not update "ticks" and "expired" since the timer will be
470
470
* re-programmed again in the following timerfd_setup() call.
471
471
*/
472
- if (ctx -> expired && ctx -> tintv . tv64 ) {
472
+ if (ctx -> expired && ctx -> tintv ) {
473
473
if (isalarm (ctx ))
474
474
alarm_forward_now (& ctx -> t .alarm , ctx -> tintv );
475
475
else
@@ -499,7 +499,7 @@ static int do_timerfd_gettime(int ufd, struct itimerspec *t)
499
499
ctx = f .file -> private_data ;
500
500
501
501
spin_lock_irq (& ctx -> wqh .lock );
502
- if (ctx -> expired && ctx -> tintv . tv64 ) {
502
+ if (ctx -> expired && ctx -> tintv ) {
503
503
ctx -> expired = 0 ;
504
504
505
505
if (isalarm (ctx )) {
0 commit comments