Skip to content

Commit 7509c04

Browse files
committed
m68k: apollo: Replace set but not used variable by READ_ONCE()
When building with W=1: arch/m68k/apollo/config.c: In function ‘dn_timer_int’: arch/m68k/apollo/config.c:171:32: warning: variable ‘x’ set but not used [-Wunused-but-set-variable] 149 | volatile unsigned char x; | ^ Fix this by using READ_ONCE(), and removing the variable. As READ_ONCE() casts to volatile internally, remove the existing cast. Deduplicate the remaining casts by introducing an intermediary. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/d0299797d6bf747eca2da998c6c6256485a9f52e.1694613528.git.geert@linux-m68k.org
1 parent 55775fe commit 7509c04

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/m68k/apollo/config.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ void __init config_apollo(void)
146146

147147
irqreturn_t dn_timer_int(int irq, void *dev_id)
148148
{
149-
volatile unsigned char x;
149+
unsigned char *at = (unsigned char *)apollo_timer;
150150

151151
legacy_timer_tick(1);
152152
timer_heartbeat();
153153

154-
x = *(volatile unsigned char *)(apollo_timer + 3);
155-
x = *(volatile unsigned char *)(apollo_timer + 5);
154+
READ_ONCE(*(at + 3));
155+
READ_ONCE(*(at + 5));
156156

157157
return IRQ_HANDLED;
158158
}

0 commit comments

Comments
 (0)