linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sun Jian <sun.jian.kdev@gmail.com>
To: linux-staging@lists.linux.dev
Cc: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
	gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
	Sun Jian <sun.jian.kdev@gmail.com>
Subject: [PATCH] staging: sm750fb: fix unused tmp in sw_i2c_wait
Date: Mon,  5 Jan 2026 10:10:26 +0800	[thread overview]
Message-ID: <20260105021026.556244-1-sun.jian.kdev@gmail.com> (raw)

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


             reply	other threads:[~2026-01-05  2:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05  2:10 Sun Jian [this message]
2026-01-05  6:28 ` [PATCH] staging: sm750fb: fix unused tmp in sw_i2c_wait 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

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=20260105021026.556244-1-sun.jian.kdev@gmail.com \
    --to=sun.jian.kdev@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    /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;
as well as URLs for NNTP newsgroup(s).