Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Ethan Nelson-Moore <enelsonmoore@gmail.com>,
	Russell King <linux@armlinux.org.uk>
Subject: [PATCH] ARM: footbridge: resolve set-but-not-used variable warnings
Date: Sun, 17 May 2026 19:55:05 -0700	[thread overview]
Message-ID: <20260518025506.238288-1-enelsonmoore@gmail.com> (raw)

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>
---
 arch/arm/mach-footbridge/netwinder-hw.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --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



                 reply	other threads:[~2026-05-18  2:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260518025506.238288-1-enelsonmoore@gmail.com \
    --to=enelsonmoore@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox