The ktime_to_us implementation is slightly better than the one implemented
in menu.c. Use it
Signed-off-by: Mel Gorman <mgorman@suse.de>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
int i;
unsigned int interactivity_req;
- struct timespec t;
if (data->needs_update) {
menu_update(drv, dev);
return 0;
/* determine the expected residency time, round up */
- t = ktime_to_timespec(tick_nohz_get_sleep_length());
- data->next_timer_us =
- t.tv_sec * USEC_PER_SEC + t.tv_nsec / NSEC_PER_USEC;
+ data->next_timer_us = ktime_to_us(tick_nohz_get_sleep_length());
data->bucket = which_bucket(data->next_timer_us);