Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966332AbcCPKV7 (ORCPT ); Wed, 16 Mar 2016 06:21:59 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:36416 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965962AbcCPKV4 (ORCPT ); Wed, 16 Mar 2016 06:21:56 -0400 From: Alexander Kuleshov To: John Stultz , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Alexander Kuleshov Subject: [PATCH] clocksource: use clocksource_freq2mult() helper Date: Wed, 16 Mar 2016 16:21:15 +0600 Message-Id: <1458123675-20001-1-git-send-email-kuleshovmail@gmail.com> X-Mailer: git-send-email 2.8.0.rc2.216.g1477fb2.dirty Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 812 Lines: 25 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 --- 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