public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: sm750fb: fix unused tmp in sw_i2c_wait
@ 2026-01-05  2:10 Sun Jian
  2026-01-05  6:28 ` Greg KH
  2026-01-05  7:49 ` [PATCH v2] " Sun Jian
  0 siblings, 2 replies; 6+ messages in thread
From: Sun Jian @ 2026-01-05  2:10 UTC (permalink / raw)
  To: linux-staging; +Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, Sun Jian

clang W=1 warns that 'tmp' is set but not used in sw_i2c_wait().

Replace the dummy loop with cpu_relax() to keep the delay loop without
triggering -Wunused-but-set-variable.

No functional change intended.

Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c
index 0ef8d4ff2ef9..279a1a10f132 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -92,12 +92,11 @@ static void sw_i2c_wait(void)
      * it's more reliable than counter loop ..
      * write 0x61 to 0x3ce and read from 0x3cf
      */
-	int i, tmp;
+	int i;
+
+	for (i = 0; i < 600; i++)
+		cpu_relax();
 
-	for (i = 0; i < 600; i++) {
-		tmp = i;
-		tmp += i;
-	}
 }
 
 /*
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-01-05  9:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05  2:10 [PATCH] staging: sm750fb: fix unused tmp in sw_i2c_wait Sun Jian
2026-01-05  6:28 ` Greg KH
2026-01-05  7:49 ` [PATCH v2] " Sun Jian
2026-01-05  8:05   ` Greg KH
2026-01-05  8:57     ` sun jian
2026-01-05  9:12       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox