[tip: timers/core] clocksource/drivers/renesas-ostm: Use DIV_ROUND_CLOSEST() helper
From: tip-bot2 for Geert Uytterhoeven
Date: Mon Aug 26 2019 - 18:53:10 EST
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 8d18f6fc75c86b2efa5865655a0630a083c8a1fd
Gitweb: https://git.kernel.org/tip/8d18f6fc75c86b2efa5865655a0630a083c8a1fd
Author: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
AuthorDate: Wed, 07 Aug 2019 10:46:33 +02:00
Committer: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
CommitterDate: Tue, 27 Aug 2019 00:31:39 +02:00
clocksource/drivers/renesas-ostm: Use DIV_ROUND_CLOSEST() helper
Use the DIV_ROUND_CLOSEST() helper instead of open-coding the same
operation.
Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Reviewed-by: Simon Horman <horms+renesas@xxxxxxxxxxxx>
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
---
drivers/clocksource/renesas-ostm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c
index 61d5f3b..37c39b9 100644
--- a/drivers/clocksource/renesas-ostm.c
+++ b/drivers/clocksource/renesas-ostm.c
@@ -221,7 +221,7 @@ static int __init ostm_init(struct device_node *np)
}
rate = clk_get_rate(ostm_clk);
- ostm->ticks_per_jiffy = (rate + HZ / 2) / HZ;
+ ostm->ticks_per_jiffy = DIV_ROUND_CLOSEST(rate, HZ);
/*
* First probed device will be used as system clocksource. Any