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


Groups > linux.kernel > #1665226 > unrolled thread

[PATCH] drivers/clocksource/fttmr010: Factor clock read code

Started byLinus Walleij <linus.walleij@linaro.org>
First post2017-06-13 23:50 +0200
Last post2017-06-14 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers/clocksource/fttmr010: Factor clock read code Linus Walleij <linus.walleij@linaro.org> - 2017-06-13 23:50 +0200
    Re: [PATCH] drivers/clocksource/fttmr010: Factor clock read code Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-06-14 10:50 +0200

#1665226 — [PATCH] drivers/clocksource/fttmr010: Factor clock read code

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-06-13 23:50 +0200
Subject[PATCH] drivers/clocksource/fttmr010: Factor clock read code
Message-ID<tS1Rg-4OB-9@gated-at.bofh.it>
The sched_clock() and delay timer callbacks can just call
each other and we can save an #ifdef.

Suggested-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Andrew Jeffery <andrew@aj.id.au>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Daniel: feel free to apply as-is or squash into the other
patch as you like.
---
 drivers/clocksource/timer-fttmr010.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c
index 0074d89cd2ce..bb07787229b6 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)
 {
-- 
2.9.4

[toc] | [next] | [standalone]


#1665586

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2017-06-14 10:50 +0200
Message-ID<tSc9X-2Vf-19@gated-at.bofh.it>
In reply to#1665226
On 13/06/2017 23:48, Linus Walleij wrote:
> The sched_clock() and delay timer callbacks can just call
> each other and we can save an #ifdef.
> 
> Suggested-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Andrew Jeffery <andrew@aj.id.au>
> Cc: Joel Stanley <joel@jms.id.au>
> Cc: Jonas Jensen <jonas.jensen@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Daniel: feel free to apply as-is or squash into the other
> patch as you like.
> ---
>  drivers/clocksource/timer-fttmr010.c | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
Applied thanks!

 -- Daniel

 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web