summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2014-08-06 14:19:19 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-08-06 21:17:44 +0200
commit107d4f4601a1408d04a5b54ffba507c92c235f58 (patch)
tree55a7d8cdeb5b530664dd6616414ad97236739025 /drivers/cpuidle
parentae77930060338226a4377d3b93580c43b5ec82ae (diff)
downloadlinux-107d4f4601a1408d04a5b54ffba507c92c235f58.tar.bz2
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>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/governors/menu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index c36e1ea7ef08..ba6df6044fff 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -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 i;
unsigned int interactivity_req;
- struct timespec t;
if (data->needs_update) {
menu_update(drv, dev);
@@ -310,9 +309,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *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);