* [PATCH] ARM: footbridge: resolve set-but-not-used variable warnings
@ 2026-05-18 2:55 Ethan Nelson-Moore
0 siblings, 0 replies; only message in thread
From: Ethan Nelson-Moore @ 2026-05-18 2:55 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: Ethan Nelson-Moore, Russell King
In several functions in arch/arm/mach-footbridge/netwinder-hw.c, the
value of the variable i is only used if DEBUG is defined (because
dprintk() expands to nothing if it is not defined). This causes
compilation warnings when building with W=1 if DEBUG is not defined.
Resolve this issue by only defining the variable if DEBUG is defined.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
| 14 ++++++++++++++
1 file changed, 14 insertions(+)
--git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index 85367ea15c5c..a33f4c3b9505 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -469,13 +469,17 @@ static inline void rwa010_global_init(void)
static inline void rwa010_game_port_init(void)
{
+#ifdef DEBUG
int i;
+#endif
WRITE_RWA(7, 5);
dprintk("Slider base: ");
WRITE_RWA(0x61, 1);
+#ifdef DEBUG
i = inb(0x203);
+#endif
WRITE_RWA(0x60, 2);
dprintk("%02X%02X (201)\n", inb(0x203), i);
@@ -485,13 +489,17 @@ static inline void rwa010_game_port_init(void)
static inline void rwa010_waveartist_init(int base, int irq, int dma)
{
+#ifdef DEBUG
int i;
+#endif
WRITE_RWA(7, 0);
dprintk("WaveArtist base: ");
WRITE_RWA(0x61, base & 255);
+#ifdef DEBUG
i = inb(0x203);
+#endif
WRITE_RWA(0x60, base >> 8);
dprintk("%02X%02X (%X),", inb(0x203), i, base);
@@ -507,13 +515,17 @@ static inline void rwa010_waveartist_init(int base, int irq, int dma)
static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, int dma)
{
+#ifdef DEBUG
int i;
+#endif
WRITE_RWA(7, 1);
dprintk("SoundBlaster base: ");
WRITE_RWA(0x61, sb_base & 255);
+#ifdef DEBUG
i = inb(0x203);
+#endif
WRITE_RWA(0x60, sb_base >> 8);
dprintk("%02X%02X (%X),", inb(0x203), i, sb_base);
@@ -528,7 +540,9 @@ static inline void rwa010_soundblaster_init(int sb_base, int al_base, int irq, i
dprintk("AdLib base: ");
WRITE_RWA(0x63, al_base & 255);
+#ifdef DEBUG
i = inb(0x203);
+#endif
WRITE_RWA(0x62, al_base >> 8);
dprintk("%02X%02X (%X)\n", inb(0x203), i, al_base);
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-18 2:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 2:55 [PATCH] ARM: footbridge: resolve set-but-not-used variable warnings Ethan Nelson-Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox