clocksource: kona: fix __iomem annotation
PATCH 1/1 clocksource: kona: fix __iomem annotation
It makes no sense to hide the __iomem annotation from the function that uses it, especially since it causes a sparse warning:
drivers/clocksource/bcm_kona_timer.c:118:38: warning: incorrect type in argument 1 (different address spaces)drivers/clocksource/bcm_kona_timer.c:118:38: expected void *timer_basedrivers/clocksource/bcm_kona_timer.c:118:38: got void [noderef] <asn:2>*static [toplevel] tmr_regs
--- drivers/clocksource/bcm_kona_timer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/clocksource/bcm_kona_timer.c +4 -5
@@ -68,9 +68,8 @@ static void kona_timer_disable_and_clear(void __iomem *base) }static void -kona_timer_get_counter (void *timer_base,uint32_t *msw,uint32_t *lsw) +kona_timer_get_counter (void __iomem *timer_base,uint32_t *msw,uint32_t *lsw) { -void __iomem *base =IOMEM (timer_base);int loop_limit =4 ;/*
@@ -86,9 +85,9 @@ kona_timer_get_counter(void *timer_base, uint32_t *msw, uint32_t *lsw)*/ while (--loop_limit) { - *msw =readl (base +KONA_GPTIMER_STCHI_OFFSET ); - *lsw =readl (base +KONA_GPTIMER_STCLO_OFFSET ); -if (*msw ==readl (base +KONA_GPTIMER_STCHI_OFFSET )) + *msw =readl (timer_base +KONA_GPTIMER_STCHI_OFFSET ); + *lsw =readl (timer_base +KONA_GPTIMER_STCLO_OFFSET ); +if (*msw ==readl (timer_base +KONA_GPTIMER_STCHI_OFFSET ))break ; }if (!loop_limit) {
Signature · 1 line
1.7.10.4
Quoted 8 lines · Olof Johansson
It makes no sense to hide the
__iomemannotation from the function that uses it, especially since it causes a sparse warning:
drivers/clocksource/bcm_kona_timer.c:118:38: warning: incorrect type in argument 1 (different address spaces)drivers/clocksource/bcm_kona_timer.c:118:38: expected void*timer_basedrivers/clocksource/bcm_kona_timer.c:118:38: got void [noderef] <asn:2>*static [toplevel]tmr_regsSigned-off-by Olof Johansson <[email protected]>
Quoted 33 lines
--- drivers/clocksource/bcm_kona_timer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/clocksource/bcm_kona_timer.c +4
-5@@ -68,9 +68,8 @@ static void kona_timer_disable_and_clear(void __iomem *base) }static void -kona_timer_get_counter (void *timer_base,uint32_t *msw,uint32_t *lsw) +kona_timer_get_counter (void __iomem *timer_base,uint32_t *msw,uint32_t *lsw) { -void __iomem *base =IOMEM (timer_base);int loop_limit =4 ;/* @@ -86,9 +85,9 @@ kona_timer_get_counter(void *timer_base, uint32_t *msw, uint32_t *lsw)*/ while (--loop_limit) { - *msw =readl (base +KONA_GPTIMER_STCHI_OFFSET ); - *lsw =readl (base +KONA_GPTIMER_STCLO_OFFSET ); -if (*msw ==readl (base +KONA_GPTIMER_STCHI_OFFSET )) + *msw =readl (timer_base +KONA_GPTIMER_STCHI_OFFSET ); + *lsw =readl (timer_base +KONA_GPTIMER_STCLO_OFFSET ); +if (*msw ==readl (timer_base +KONA_GPTIMER_STCHI_OFFSET ))break ; }if (!loop_limit) {