Skip to content

Commit

Permalink
cpuidle: menu: Use ktime_to_us instead of reinventing the wheel
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mel Gorman authored and Rafael J. Wysocki committed Aug 6, 2014
1 parent ae77930 commit 107d4f4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 107d4f4

Please sign in to comment.