From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754468AbcIDBbS (ORCPT ); Sat, 3 Sep 2016 21:31:18 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35354 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754240AbcIDB3v (ORCPT ); Sat, 3 Sep 2016 21:29:51 -0400 From: Nicolai Stange To: Thomas Gleixner Cc: John Stultz , linux-kernel@vger.kernel.org, Nicolai Stange Subject: [RFC v5 20/23] clockevents: purge ->min_delta_ns Date: Sun, 4 Sep 2016 03:28:49 +0200 Message-Id: <20160904012852.17814-9-nicstange@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160904010200.17200-1-nicstange@gmail.com> References: <20160904010200.17200-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