[hrtimer] Change resolution storage to ktime_t format

Change the storage format of the per base resolution to ktime_t to
make it easier accessible in the hrtimers code.

Change the resolution from (NSEC_PER_SEC/HZ) to TICK_NSEC as Roman
pointed out. TICK_NSEC is closer to the real resolution.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

+4 -5
+1 -1
include/linux/hrtimer.h
··· 85 85 spinlock_t lock; 86 86 struct rb_root active; 87 87 struct rb_node *first; 88 - unsigned long resolution; 88 + ktime_t resolution; 89 89 ktime_t (*get_time)(void); 90 90 struct hrtimer *curr_timer; 91 91 };
+2 -2
include/linux/ktime.h
··· 272 272 * idea of the (in)accuracy of timers. Timer values are rounded up to 273 273 * this resolution values. 274 274 */ 275 - #define KTIME_REALTIME_RES (NSEC_PER_SEC/HZ) 276 - #define KTIME_MONOTONIC_RES (NSEC_PER_SEC/HZ) 275 + #define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC } 276 + #define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC } 277 277 278 278 /* Get the monotonic time in timespec format: */ 279 279 extern void ktime_get_ts(struct timespec *ts);
+1 -2
kernel/hrtimer.c
··· 518 518 { 519 519 struct hrtimer_base *bases; 520 520 521 - tp->tv_sec = 0; 522 521 bases = per_cpu(hrtimer_bases, raw_smp_processor_id()); 523 - tp->tv_nsec = bases[which_clock].resolution; 522 + *tp = ktime_to_timespec(bases[which_clock].resolution); 524 523 525 524 return 0; 526 525 }