diff options
author | Mel Gorman <mgorman@suse.de> | 2014-08-06 14:19:19 +0100 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2015-01-21 10:39:11 +0800 |
commit | 25f22033067670fe6dd2da3d6be9e59706b368f2 (patch) | |
tree | 23edf2eeabc351b3ef6ee1c8da411a16140ffda6 | |
parent | 8aafd2be78573ca402f68b0637646e45c43b4f38 (diff) |
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: Mel Gorman <mgorman@suse.de>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 107d4f4601a1408d04a5b54ffba507c92c235f58)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | drivers/cpuidle/governors/menu.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 5d0223838b0..aa00352c609 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -289,7 +289,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, struct menu_device *data = this_cpu_ptr(&menu_devices); int i; unsigned int interactivity_req; - struct timespec t; if (data->needs_update) { menu_update(drv, dev); @@ -299,9 +298,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, data->last_state_idx = CPUIDLE_DRIVER_STATE_START - 1; /* 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); |