From patchwork Mon Nov 9 10:06:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 56198 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp90736lbb; Mon, 9 Nov 2015 02:07:35 -0800 (PST) X-Received: by 10.66.243.225 with SMTP id xb1mr38691427pac.1.1447063655285; Mon, 09 Nov 2015 02:07:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl1si21496649pad.11.2015.11.09.02.07.34; Mon, 09 Nov 2015 02:07:35 -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 S1752845AbbKIKH1 (ORCPT + 28 others); Mon, 9 Nov 2015 05:07:27 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36887 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbbKIKHU (ORCPT ); Mon, 9 Nov 2015 05:07:20 -0500 Received: by wmww144 with SMTP id w144so25937697wmw.0 for ; Mon, 09 Nov 2015 02:07:19 -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=8mjCYE641Pc3cshApLufbKLoJGunDJQHLy9Z7tDndBo=; b=wQYTjlAgMNexPyE/wdYBphInn1Mr8BGsRgR2tNsA5q2E7eWfPB1Itcyi8lejpeWKy5 0p7cG+/nfNHGVOHK2FvChznbq+Tgz5YuWExa6RzKHFg5TbJ+kJu5O9SuR5BYP0/578zQ I34/nc/7dR9fxWyFxbnJ+/JylUHhAHBSRlH6o1W7JFgUSItV44NnUFgF/AjWBodUePfx BVx23RosdtQt9Q6b2M5/XsVflCBoWEAMkW8NNTufzUqFIGo2fPg8kobg0azyEoKxKVxG v4aG5fMtT1PW+LR91j3yv8WkDRw/82WAJ+wyHnyrlu3bLeIF9Zj/Hg1SN0AI9GWvOGLi hqlw== 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=8mjCYE641Pc3cshApLufbKLoJGunDJQHLy9Z7tDndBo=; b=VzuAUOQVBE1Hauvw/+7dWQD5f1+BuwnQveMLsG+1Eaz1QMqiaDlngpK7oixQyrUmXU X23zOeKpoAMZdw0foyJpWXHZiUC+mh15Yut/58u+SnCkOEcPgtSnijeRadd3id0JybBa YH7zKSgBPylKXsvPHaCiQkRFyrIHgbnkdRhlmU6s5L/9bx4SXKtlrz+o/zjEWp1Ua1sC HP11/PRTXSoy7OTuPjTLylidFvqI3ZTVQvafmK4sTFoOqjxPT3fIB816IUyjCkdcEuJk aEFUyPjCMSYqHD+TDDJjYfVuYpFbvElprzoHt1Jau7DzV63Bd4ySOfbnCjh2dP/FFSj1 rJVg== X-Gm-Message-State: ALoCoQlgC6XQefFKxkv0TzcJwf8nFdfDT4sz/jXQVdUPeLvJCdZRoxDosMlgVn+aVBpW3zU+1/zL X-Received: by 10.28.63.22 with SMTP id m22mr10671470wma.58.1447063639294; Mon, 09 Nov 2015 02:07:19 -0800 (PST) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id t126sm13384201wmd.23.2015.11.09.02.07.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Nov 2015 02:07:18 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: ysato@users.sourceforge.jp, tglx@linutronix.de, linux-kernel@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp (moderated list:H8/300 ARCHITECTURE) Subject: [PATCH 06/15] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro Date: Mon, 9 Nov 2015 11:06:44 +0100 Message-Id: <1447063614-4662-6-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447063614-4662-1-git-send-email-daniel.lezcano@linaro.org> References: <1447063614-4662-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 88b9b06..2433325 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; }