From patchwork Wed Jun 14 12:39:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 105507 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp272260qgd; Wed, 14 Jun 2017 05:43:11 -0700 (PDT) X-Received: by 10.99.50.135 with SMTP id y129mr447789pgy.238.1497444191661; Wed, 14 Jun 2017 05:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497444191; cv=none; d=google.com; s=arc-20160816; b=zPlz/gcpt4MQwdDQ6DwxZ4kdNe8bsAg0wZELSqeTPHFpTjNHsCxMYRnCy1jLNVaSp5 697EsbPNYP3Pu4n9rBMQhNWMz9MQQv80m9YhYm8eP1wlv25oAFPlRMoXFNcMey8b3i/g 1Qh7CKVP6aH5ACPkUVsdOWD+jljjawXK+E/Gl0/G4NxNV5mgDvhYKhph5lMfpKoEVSvv uUTsCVX8aId2jDMI52g4xD5uVIL5sdER61JSXR83xNMCQKl/WrG8SfgKZrKCYRNvazO5 PQ/T271gigyhgWMot/uzUzxCAT/6S71rkFS29uCyNV2UsuUiqjL8JEWBWtpuzkVClRxU KOhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=5HcXZc9cRWP5d9tLjGDE2UH9sb7Kd1xHLfGjUubEA0w=; b=oibtrf3+67AUmPrAYUO/ghBAyQCeSU7ZsNMNUsvNgokGL2jB2Sqt4wrUXhWSK3wY7j EJxIEzhE7duB2MA6N7Utla30zwI0WO4bLnBpZ9tU2Vf+FC8LIDeBLW6ujhF+CeyJQHXd 8V1l1tm0M9srP3RcNy5FVfmcYghmkiO5WrzGct6I99s313B7nfMIV6SwO5nHf+eDFmEi Y+T6Qib0TU7MYHh7cUY4X/xQ0aBYCNnaAbH2JcJSX2JUiJmyv18i3zXg7ua3/XICdrzj sByGJXDiy+9csvff+l8+WU2PJt5MOdMxcWNZLqYi3KkRroI95bIcmuLvJmhviQ8CqSgy Mmvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=iBaG5aap; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g92si631080plg.54.2017.06.14.05.43.11; Wed, 14 Jun 2017 05:43:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=iBaG5aap; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752774AbdFNMnD (ORCPT + 25 others); Wed, 14 Jun 2017 08:43:03 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:33333 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbdFNMmV (ORCPT ); Wed, 14 Jun 2017 08:42:21 -0400 Received: by mail-wr0-f176.google.com with SMTP id v104so175923440wrb.0 for ; Wed, 14 Jun 2017 05:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5HcXZc9cRWP5d9tLjGDE2UH9sb7Kd1xHLfGjUubEA0w=; b=iBaG5aaphW8fkdSbktxTHK/71jDSisc16hiymvnNfnPXSFPLMSbO2JOYkfwWI+btXW +K6FCYM9mOR2AtvrgVmqxWFFl+zHwCGwzwk+GYJXWy7erFetB7bJDXIzmyNA5iAHddXw cGXMPbY2zhkB1txGSAqeT7ngIdPXHsWVNOHmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5HcXZc9cRWP5d9tLjGDE2UH9sb7Kd1xHLfGjUubEA0w=; b=FUk1n7TzRGI2Flqtl6BUotO5636E6SJdQWvhytM7LzaDwklrAeK6BFhAcq9N79yfnd bhBljYLrwDi8KaShCEDpqW85Q4Omcd1AKZK4zhgLfFsRfv3fWaeGKM1a5ifqc6kNmEN5 663cVhzxxcqB0Osoraf9kx4Y3dzE4zfGlRPg9sy2qdALYUsCll04ntoB9PW6MUaIEZdV I5Sh5tT8WjqyfQyeCeYGPR87U2KJg8P/A9ZXa5U47Oz+f0vgVcVWdSCKWOCFdvG1JJVD G4Oo9dcqSMrjCsHK0k7z1Yc0GMtXmrIfucMSn+PsO2duIWVTzvFHKXl9u1AKECNZ/1cT pMnw== X-Gm-Message-State: AKS2vOyqT+SI6+iDfStPFrrMhwI0/WGvfKhXteHVEYbKQQnJD0FUvMJR 9t3gXJkUruHktu5lTRK06Ivz X-Received: by 10.28.45.5 with SMTP id t5mr8532538wmt.50.1497444139377; Wed, 14 Jun 2017 05:42:19 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:19a:b336:54d7:46e9]) by smtp.gmail.com with ESMTPSA id 80sm1457015wmg.17.2017.06.14.05.42.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jun 2017 05:42:18 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Linus Walleij , Andrew Jeffery , Joel Stanley , Jonas Jensen Subject: [PATCH 23/23] clocksource/drivers/fttmr010: Factor out clock read code Date: Wed, 14 Jun 2017 14:39:44 +0200 Message-Id: <1497443984-12371-23-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497443984-12371-1-git-send-email-daniel.lezcano@linaro.org> References: <20170614123800.GH2261@mai> <1497443984-12371-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij The sched_clock() and delay timer callbacks can just call each other and we can save an #ifdef. Suggested-by: Daniel Lezcano Cc: Andrew Jeffery Cc: Joel Stanley Cc: Jonas Jensen Signed-off-by: Linus Walleij Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-fttmr010.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index 0093704..66dd909 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -98,30 +98,26 @@ static inline struct fttmr010 *to_fttmr010(struct clock_event_device *evt) return container_of(evt, struct fttmr010, clkevt); } -static u64 notrace fttmr010_read_sched_clock_up(void) +static unsigned long fttmr010_read_current_timer_up(void) { return readl(local_fttmr->base + TIMER2_COUNT); } -static u64 notrace fttmr010_read_sched_clock_down(void) +static unsigned long fttmr010_read_current_timer_down(void) { return ~readl(local_fttmr->base + TIMER2_COUNT); } -#ifdef CONFIG_ARM - -static unsigned long fttmr010_read_current_timer_up(void) +static u64 notrace fttmr010_read_sched_clock_up(void) { - return readl(local_fttmr->base + TIMER2_COUNT); + return fttmr010_read_current_timer_up(); } -static unsigned long fttmr010_read_current_timer_down(void) +static u64 notrace fttmr010_read_sched_clock_down(void) { - return ~readl(local_fttmr->base + TIMER2_COUNT); + return fttmr010_read_current_timer_down(); } -#endif - static int fttmr010_timer_set_next_event(unsigned long cycles, struct clock_event_device *evt) {