Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1358802

[PATCH] clocksource: use clocksource_freq2mult() helper

From Alexander Kuleshov <kuleshovmail@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] clocksource: use clocksource_freq2mult() helper
Date 2016-03-16 11:30 +0100
Message-ID <rdgSe-7Ep-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


which is introduced in the 7aca0c072 commit to simplify calculation of
the mult and shift in the clocks_calc_mult_shift().

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 kernel/time/clocksource.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 56ece14..de57923 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -80,9 +80,7 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 maxsec)
 	 * accuracy and fits the maxsec conversion range:
 	 */
 	for (sft = 32; sft > 0; sft--) {
-		tmp = (u64) to << sft;
-		tmp += from / 2;
-		do_div(tmp, from);
+		tmp = clocksource_freq2mult(from, sft, to);
 		if ((tmp >> sftacc) == 0)
 			break;
 	}
-- 
2.8.0.rc2.216.g1477fb2.dirty

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] clocksource: use clocksource_freq2mult() helper Alexander Kuleshov <kuleshovmail@gmail.com> - 2016-03-16 11:30 +0100

csiph-web