From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755257AbcIIUTN (ORCPT ); Fri, 9 Sep 2016 16:19:13 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33737 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754936AbcIIUSi (ORCPT ); Fri, 9 Sep 2016 16:18:38 -0400 From: Nicolai Stange To: Thomas Gleixner Cc: John Stultz , linux-kernel@vger.kernel.org, Nicolai Stange Subject: [RFC v6 20/23] clockevents: purge ->min_delta_ns Date: Fri, 9 Sep 2016 22:18:09 +0200 Message-Id: <20160909201812.32396-5-nicstange@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909200033.32103-1-nicstange@gmail.com> References: <20160909200033.32103-1-nicstange@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The struct clock_event_device's ->min_delta_ns member isn't used anymore. Purge it. In __clockevents_update_bounds(), shortcut the ->min_delta_ticks => ->min_delta_ns => ->min_delta_ticks_adjusted calculation detour -- it had been made solely for the purpose of ensuring that ->min_delta_ticks_adjusted corresponds to something >= 1us. Signed-off-by: Nicolai Stange --- include/linux/clockchips.h | 2 -- kernel/time/clockevents.c | 12 +++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 7c3a193..2ff15f03 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -94,7 +94,6 @@ enum clock_event_state { * @tick_resume: resume clkevt device * @broadcast: function to broadcast events * @min_delta_ticks: minimum delta value in ticks stored for reconfiguration - * @min_delta_ns: minimum delta value in ns * @name: ptr to clock event name * @rating: variable to rate clock event devices * @irq: IRQ number (only for non CPU local devices) @@ -127,7 +126,6 @@ struct clock_event_device { void (*suspend)(struct clock_event_device *); void (*resume)(struct clock_event_device *); unsigned long min_delta_ticks; - u64 min_delta_ns; const char *name; int rating; diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 86d9f97..394b8dc 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -492,14 +492,12 @@ static void __clockevents_update_bounds(struct clock_event_device *dev) } /* - * cev_delta2ns() never returns values less than 1us and thus, - * we'll never program any ced with anything less. + * Enforce ->min_delta_ticks_adjusted to correspond to a value + * >= 1us. */ - dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false); - dev->min_delta_ticks_adjusted = (unsigned long)((dev->min_delta_ns * - dev->mult) >> dev->shift); - dev->min_delta_ticks_adjusted = max(dev->min_delta_ticks_adjusted, - dev->min_delta_ticks); + dev->min_delta_ticks_adjusted = + max(dev->min_delta_ticks, + (unsigned long)((1000ULL * dev->mult) >> dev->shift)); } /** -- 2.9.3