Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265235

[RFC PATCH 05/10] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro

From Daniel Lezcano <daniel.lezcano@linaro.org>
Newsgroups linux.kernel
Subject [RFC PATCH 05/10] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
Date 2015-11-08 23:40 +0100
Message-ID <qsGMX-6dI-35@gated-at.bofh.it> (permalink)
References <qsGMW-6dI-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <daniel.lezcano@linaro.org>
---
 drivers/clocksource/h8300_timer8.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

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;
 }
-- 
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 01/10] clocksource/drivers/h8300: Remove unused macros Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:40 +0100
  [RFC PATCH 10/10] clocksource/drivers/h8300_timer8: Retrieve the clock rate at init time Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:40 +0100
  [RFC PATCH 08/10] clocksource/drivers/h8300_timer8: Remove irq and lock legacy code Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:40 +0100
  Re: [RFC PATCH 01/10] clocksource/drivers/h8300: Remove unused macros Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:40 +0100
  [RFC PATCH 05/10] clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:40 +0100
  [RFC PATCH 09/10] h8300: Rename ctlr_out/in[bwl] to read/write[bwl] Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:40 +0100
  [RFC PATCH 03/10] clocksource/drivers/h8300_timer8: Remove unused headers Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:50 +0100
  [RFC PATCH 04/10] clocksource/drivers/h8300_timer8: Remove unused macros Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-08 23:50 +0100

csiph-web