Commit 107d4f46 authored by Mel Gorman's avatar Mel Gorman Committed by Rafael J. Wysocki

cpuidle: menu: Use ktime_to_us instead of reinventing the wheel

The ktime_to_us implementation is slightly better than the one implemented
in menu.c. Use it
Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent ae779300
...@@ -296,7 +296,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) ...@@ -296,7 +296,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
int i; int i;
unsigned int interactivity_req; unsigned int interactivity_req;
struct timespec t;
if (data->needs_update) { if (data->needs_update) {
menu_update(drv, dev); menu_update(drv, dev);
...@@ -310,9 +309,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) ...@@ -310,9 +309,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
return 0; return 0;
/* determine the expected residency time, round up */ /* determine the expected residency time, round up */
t = ktime_to_timespec(tick_nohz_get_sleep_length()); data->next_timer_us = ktime_to_us(tick_nohz_get_sleep_length());
data->next_timer_us =
t.tv_sec * USEC_PER_SEC + t.tv_nsec / NSEC_PER_USEC;
data->bucket = which_bucket(data->next_timer_us); data->bucket = which_bucket(data->next_timer_us);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment