@@ -396,16 +396,16 @@ static __maybe_unused __kernel_old_time_t __cvdso_time(__kernel_old_time_t *time
396
396
397
397
#ifdef VDSO_HAS_CLOCK_GETRES
398
398
static __maybe_unused
399
- int __cvdso_clock_getres_common (const struct vdso_time_data * vd , clockid_t clock ,
400
- struct __kernel_timespec * res )
399
+ bool __cvdso_clock_getres_common (const struct vdso_time_data * vd , clockid_t clock ,
400
+ struct __kernel_timespec * res )
401
401
{
402
402
const struct vdso_clock * vc = vd -> clock_data ;
403
403
u32 msk ;
404
404
u64 ns ;
405
405
406
406
/* Check for negative values or invalid clocks */
407
407
if (unlikely ((u32 ) clock >= MAX_CLOCKS ))
408
- return -1 ;
408
+ return false ;
409
409
410
410
if (IS_ENABLED (CONFIG_TIME_NS ) &&
411
411
vc -> clock_mode == VDSO_CLOCKMODE_TIMENS )
@@ -427,23 +427,25 @@ int __cvdso_clock_getres_common(const struct vdso_time_data *vd, clockid_t clock
427
427
*/
428
428
ns = LOW_RES_NSEC ;
429
429
} else {
430
- return -1 ;
430
+ return false ;
431
431
}
432
432
433
433
if (likely (res )) {
434
434
res -> tv_sec = 0 ;
435
435
res -> tv_nsec = ns ;
436
436
}
437
- return 0 ;
437
+ return true ;
438
438
}
439
439
440
440
static __maybe_unused
441
441
int __cvdso_clock_getres_data (const struct vdso_time_data * vd , clockid_t clock ,
442
442
struct __kernel_timespec * res )
443
443
{
444
- int ret = __cvdso_clock_getres_common ( vd , clock , res ) ;
444
+ bool ok ;
445
445
446
- if (unlikely (ret ))
446
+ ok = __cvdso_clock_getres_common (vd , clock , res );
447
+
448
+ if (unlikely (!ok ))
447
449
return clock_getres_fallback (clock , res );
448
450
return 0 ;
449
451
}
@@ -460,18 +462,18 @@ __cvdso_clock_getres_time32_data(const struct vdso_time_data *vd, clockid_t cloc
460
462
struct old_timespec32 * res )
461
463
{
462
464
struct __kernel_timespec ts ;
463
- int ret ;
465
+ bool ok ;
464
466
465
- ret = __cvdso_clock_getres_common (vd , clock , & ts );
467
+ ok = __cvdso_clock_getres_common (vd , clock , & ts );
466
468
467
- if (unlikely (ret ))
469
+ if (unlikely (! ok ))
468
470
return clock_getres32_fallback (clock , res );
469
471
470
472
if (likely (res )) {
471
473
res -> tv_sec = ts .tv_sec ;
472
474
res -> tv_nsec = ts .tv_nsec ;
473
475
}
474
- return ret ;
476
+ return 0 ;
475
477
}
476
478
477
479
static __maybe_unused int
0 commit comments