From patchwork Sun Nov 8 22:36:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 56171 Delivered-To: patch@linaro.org Received: by 10.112.1.169 with SMTP id 9csp162182lbn; Sun, 8 Nov 2015 14:38:38 -0800 (PST) X-Received: by 10.66.142.161 with SMTP id rx1mr34654420pab.37.1447022314884; Sun, 08 Nov 2015 14:38:34 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lo9si17916714pab.201.2015.11.08.14.38.34; Sun, 08 Nov 2015 14:38:34 -0800 (PST) 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; 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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbKHWiZ (ORCPT + 28 others); Sun, 8 Nov 2015 17:38:25 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38018 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbbKHWhe (ORCPT ); Sun, 8 Nov 2015 17:37:34 -0500 Received: by wmec201 with SMTP id c201so54825216wme.1 for ; Sun, 08 Nov 2015 14:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sKHb2LPSew6WaMnDuHCtmbzFik9JLhS/L+Y9jl5jGrg=; b=iOwtv4pK3kPDzIOTcNaEa6Te5E6H3f0CbL5+Q+GKMUM97VnMeCrqsKwZKxuyzohMgx ZTJGz5vb5+UnNdZJFZKQPFzJrmtt1Oq1g1IQJL11ucKPWfwmyUrL1bHeovCkKZJ5+62E b+IdtUGNiawYRs/0ktJg+c0c7fHdHbh66lrYbmgse27NMCGvXB55pJhYqizEwpsV4dzR 9PbmoPTS1En/C3xRRzqfmTJRrfRnP311SnaDNXYatZZHLwJcwos+YPYCiy7ZshmAqUdX utwWj/xz4j482PNYwIJZNcqCA1jHPoLjT0Gg1skHTRZzWd8i8qpLbyFdvBwHb/w1Mw5/ b/jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sKHb2LPSew6WaMnDuHCtmbzFik9JLhS/L+Y9jl5jGrg=; b=SbyPdnBDiGLsYgn/RJiFumJ38r2BhcdPE16FEqdwEFK+bk0N7/8C3hUAGLPPjPKzqc xo71MmMxtphcAEBsuAqmf58UCnFBCYvmLsWee8LWjt0rtCp6o4Hh1MxL9tV/TawgeXOJ yaT7Z/gfBtrxICiLEx27/z05aSZdy7S2JQr+cdvKjJa/b34a4k9GH01iIdiwb0JEblRZ RIRHtT2SWiaJ2IWt/iNlj3jG8zFmgZLg7ZQmGwNEcNOx7uQUQV9KNlctSXOQdf2gNBqQ 57JnzHJWMlTG0oNk2/kCjdzpiyRoiZh2BPUkmKyV0Yb2/R9t5swpnlyx1xiNepIksLme bM+A== X-Gm-Message-State: ALoCoQm4pgSWMOidpWhUvsJ9lZuc2wNBIpT4BmJ2F3fzPmuLNV6ihxwRwDqzWltFyCZRbYBihm75 X-Received: by 10.28.7.68 with SMTP id 65mr22054561wmh.19.1447022253655; Sun, 08 Nov 2015 14:37:33 -0800 (PST) Received: from localhost.localdomain ([78.210.255.2]) by smtp.gmail.com with ESMTPSA id n17sm10912746wmg.17.2015.11.08.14.37.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Nov 2015 14:37:33 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, ysato@users.sourceforge.jp Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp (moderated list:H8/300 ARCHITECTURE) Subject: [RFC PATCH 05/10] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro Date: Sun, 8 Nov 2015 23:36:34 +0100 Message-Id: <1447022199-4648-5-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447022199-4648-1-git-send-email-daniel.lezcano@linaro.org> References: <1447022199-4648-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 Specify the delta as parameter for the timer8_clock_event_start function instead of using a macro to tell PERIODIC or ONESHOT. Signed-off-by: Daniel Lezcano --- drivers/clocksource/h8300_timer8.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c index 598bea2..f66cd6f 100644 --- a/drivers/clocksource/h8300_timer8.c +++ b/drivers/clocksource/h8300_timer8.c @@ -28,9 +28,6 @@ #define FLAG_IRQCONTEXT (1 << 2) #define FLAG_STARTED (1 << 3) -#define ONESHOT 0 -#define PERIODIC 1 - #define SCALE 64 struct timer8_priv { @@ -147,7 +144,7 @@ static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced) return container_of(ced, struct timer8_priv, ced); } -static void timer8_clock_event_start(struct timer8_priv *p, int periodic) +static void timer8_clock_event_start(struct timer8_priv *p, unsigned long delta) { struct clock_event_device *ced = &p->ced; @@ -158,7 +155,7 @@ static void timer8_clock_event_start(struct timer8_priv *p, int periodic) ced->max_delta_ns = clockevent_delta2ns(0xffff, ced); ced->min_delta_ns = clockevent_delta2ns(0x0001, ced); - timer8_set_next(p, periodic?(p->rate + HZ/2) / HZ:0x10000); + timer8_set_next(p, delta); } static int timer8_clock_event_shutdown(struct clock_event_device *ced) @@ -173,7 +170,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced) pr_info("%s: used for periodic clock events\n", ced->name); timer8_stop(p); - timer8_clock_event_start(p, PERIODIC); + timer8_clock_event_start(p, (p->rate + HZ/2) / HZ); return 0; } @@ -184,7 +181,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced) pr_info("%s: used for oneshot clock events\n", ced->name); timer8_stop(p); - timer8_clock_event_start(p, ONESHOT); + timer8_clock_event_start(p, 0x10000); return 0; }