From patchwork Fri Dec 18 14:17:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 58709 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp1062489lbb; Fri, 18 Dec 2015 06:30:25 -0800 (PST) X-Received: by 10.66.234.226 with SMTP id uh2mr5548954pac.6.1450449025780; Fri, 18 Dec 2015 06:30:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si20327623pfr.209.2015.12.18.06.30.25; Fri, 18 Dec 2015 06:30:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933198AbbLROaX (ORCPT + 29 others); Fri, 18 Dec 2015 09:30:23 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:34219 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964810AbbLROTZ (ORCPT ); Fri, 18 Dec 2015 09:19:25 -0500 Received: by mail-wm0-f52.google.com with SMTP id l126so67516328wml.1 for ; Fri, 18 Dec 2015 06:19:24 -0800 (PST) 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=8mjCYE641Pc3cshApLufbKLoJGunDJQHLy9Z7tDndBo=; b=NcqjOon/tiwp/XVfYL6akO7en1dv7h3pG7lblG9D8/ufBH8EWYzerSyUxkgqKWfvfL lLPn7gHOLCNIgYdTtTBcRdIXRgdjj06pr/lJKXBRxtPpDj07vgvV5/NUsGA/+UeHijqv /XNWFPWguxa3hJ8Strh5qb640cuHsMN2b6OrE= 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=RtD8jyHYZDETFe3OObTI0tO8tm2qvsAe780t1Rvud5Gww3wp/aiY7XuAw0uzJL//z8 vntHkJUex7tJoWT7E1gOThAh/Rvf2BilKeZgeA1R7e2xAH27PepTtw9arCOp/ypy0K5Z VpJ1TRZp/2dbW2r3lwmMow1UEyT8zxDlMT2leKd+mmTUZPHfztDu9nLdgml/n++JooDw 2mWdkVjqfiI2W5Jo4Y7JTj09y2qwFepMDVfhdowXx40P92/T+IuX1z1cHFLgUWRYs2Ev Mcb2L2VRWXAhjI+VnpSbfAXapfMBHGAhvFjd6dfNUKIOvH0inziKTZHETHzDUkTfM5vv lqQw== X-Gm-Message-State: ALoCoQmiCtDFEECu2NB4UdMEZtRNBayhg5m5giQVQaMsq/UgJKghDlqtfpBsNPbtc5G1arfLm/cgFjJ6pHqfx+9Owcu/uS5jgA== X-Received: by 10.194.116.40 with SMTP id jt8mr4792018wjb.57.1450448364394; Fri, 18 Dec 2015 06:19:24 -0800 (PST) Received: from localhost.localdomain ([78.210.255.2]) by smtp.gmail.com with ESMTPSA id ql10sm15010027wjc.23.2015.12.18.06.19.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 06:19:23 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mingo@kernel.org, Yoshinori Sato , uclinux-h8-devel@lists.sourceforge.jp (moderated list:H8/300 ARCHITECTURE) Subject: [PATCH 43/69] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro Date: Fri, 18 Dec 2015 15:17:56 +0100 Message-Id: <1450448302-27429-43-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450448302-27429-1-git-send-email-daniel.lezcano@linaro.org> References: <5672CB9E.7090707@linaro.org> <1450448302-27429-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; }