diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2015-11-25 11:01:52 -0500 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2015-12-15 15:41:28 -0500 |
commit | 520ddad4e560423a320bc1861792da19b0b879f9 (patch) | |
tree | 984ef3a84732fc4ec1446a491bde07664cf671e9 | |
parent | 39d3611f2d8ff5dcba523c9081e6f5e51f066c86 (diff) |
clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writel
It seems gcc can automatically inline apbt_writel() for us, but
apbt_real isn't inlined. This patch makes them inline to get a trivial
performance improvement: 4096 rounds of __apbt_read_clocksource() call
spend time on Marvell BG4CT platform:
before the patch 1275240ns on average
after the patch 1263240ns on average
so we get 1% performance improvement.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r-- | drivers/clocksource/dw_apb_timer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c index 7f95b5347a9a..63345260244d 100644 --- a/drivers/clocksource/dw_apb_timer.c +++ b/drivers/clocksource/dw_apb_timer.c | |||
@@ -49,13 +49,13 @@ clocksource_to_dw_apb_clocksource(struct clocksource *cs) | |||
49 | return container_of(cs, struct dw_apb_clocksource, cs); | 49 | return container_of(cs, struct dw_apb_clocksource, cs); |
50 | } | 50 | } |
51 | 51 | ||
52 | static u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs) | 52 | static inline u32 apbt_readl(struct dw_apb_timer *timer, unsigned long offs) |
53 | { | 53 | { |
54 | return readl(timer->base + offs); | 54 | return readl(timer->base + offs); |
55 | } | 55 | } |
56 | 56 | ||
57 | static void apbt_writel(struct dw_apb_timer *timer, u32 val, | 57 | static inline void apbt_writel(struct dw_apb_timer *timer, u32 val, |
58 | unsigned long offs) | 58 | unsigned long offs) |
59 | { | 59 | { |
60 | writel(val, timer->base + offs); | 60 | writel(val, timer->base + offs); |
61 | } | 61 | } |