From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965600AbcIPUQJ (ORCPT ); Fri, 16 Sep 2016 16:16:09 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34035 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965358AbcIPUOr (ORCPT ); Fri, 16 Sep 2016 16:14:47 -0400 From: Nicolai Stange To: Thomas Gleixner Cc: John Stultz , linux-kernel@vger.kernel.org, Nicolai Stange Subject: [RFC v7 20/23] clockevents: purge ->min_delta_ns Date: Fri, 16 Sep 2016 22:12:01 +0200 Message-Id: <20160916201204.9424-9-nicstange@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20160916200851.9273-1-nicstange@gmail.com> References: <20160916200851.9273-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.10.0