The patch titled Subject: cpuidle: menu: use DIV_ROUND_CLOSEST_ULL() has been added to the -mm tree. Its filename is cpuidle-menu-use-div_round_closest_ull.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/cpuidle-menu-use-div_round_closest_ull.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/cpuidle-menu-use-div_round_closest_ull.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Javi Merino <javi.merino@xxxxxxx> Subject: cpuidle: menu: use DIV_ROUND_CLOSEST_ULL() Now that the kernel provides DIV_ROUND_CLOSEST_ULL(), drop the internal implementation and use the kernel one. Signed-off-by: Javi Merino <javi.merino@xxxxxxx> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Stephen Hemminger <shemminger@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/cpuidle/governors/menu.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff -puN drivers/cpuidle/governors/menu.c~cpuidle-menu-use-div_round_closest_ull drivers/cpuidle/governors/menu.c --- a/drivers/cpuidle/governors/menu.c~cpuidle-menu-use-div_round_closest_ull +++ a/drivers/cpuidle/governors/menu.c @@ -190,12 +190,6 @@ static DEFINE_PER_CPU(struct menu_device static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev); -/* This implements DIV_ROUND_CLOSEST but avoids 64 bit division */ -static u64 div_round64(u64 dividend, u32 divisor) -{ - return div_u64(dividend + (divisor / 2), divisor); -} - /* * Try detecting repeating patterns by keeping track of the last 8 * intervals, and checking if the standard deviation of that set @@ -317,7 +311,7 @@ static int menu_select(struct cpuidle_dr * operands are 32 bits. * Make sure to round up for half microseconds. */ - data->predicted_us = div_round64((uint64_t)data->next_timer_us * + data->predicted_us = DIV_ROUND_CLOSEST_ULL((uint64_t)data->next_timer_us * data->correction_factor[data->bucket], RESOLUTION * DECAY); _ Patches currently in -mm which might be from javi.merino@xxxxxxx are kernelh-implement-div_round_closest_ull.patch clk-bcm-kona-use-div_round_closest_ull.patch cpuidle-menu-use-div_round_closest_ull.patch media-cxd2820r-use-div_round_closest_ull.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html