[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5406d0829d8204841c8cb8d265ca91a52cd22d2d.1694093327.git.geert@linux-m68k.org>
Date: Thu, 7 Sep 2023 15:41:26 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: linux-m68k@...ts.linux-m68k.org
Cc: Arnd Bergmann <arnd@...db.de>, Finn Thain <fthain@...ux-m68k.org>,
Michael Schmitz <schmitzmic@...il.com>,
Philip Blundell <philb@....org>,
Greg Ungerer <gerg@...ux-m68k.org>,
Joshua Thompson <funaho@...ai.org>,
Sam Creasey <sammy@...my.net>,
Laurent Vivier <laurent@...ier.eu>,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: [PATCH 25/52] 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.
Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
---
arch/m68k/apollo/config.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 0e6801eecbaf6361..fef9b8a1be673bad 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -146,13 +146,11 @@ void __init config_apollo(void)
irqreturn_t dn_timer_int(int irq, void *dev_id)
{
- volatile unsigned char x;
-
legacy_timer_tick(1);
timer_heartbeat();
- x = *(volatile unsigned char *)(apollo_timer + 3);
- x = *(volatile unsigned char *)(apollo_timer + 5);
+ READ_ONCE(*(volatile unsigned char *)(apollo_timer + 3));
+ READ_ONCE(*(volatile unsigned char *)(apollo_timer + 5));
return IRQ_HANDLED;
}
--
2.34.1
Powered by blists - more mailing lists