Linux kernel staging patches
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-staging@lists.linux.dev>
Subject: [PATCH 4/4] staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm()
Date: Thu, 12 Sep 2024 10:25:22 +0800	[thread overview]
Message-ID: <20240912022522.10715-5-pkshih@realtek.com> (raw)
In-Reply-To: <20240912022522.10715-1-pkshih@realtek.com>

The 'poll_cnt' is used to assist in polling hardware state. Current code
uses jiffies to determine timeout, so removing this value is safe.

Otherwise, clang warns:

core/rtw_pwrctrl.c:288:6: warning:
	 variable 'poll_cnt' set but not used [-Wunused-but-set-variable]
  288 |                 u8 poll_cnt = 0;
      |                    ^

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index e9763eab16f6..82f6a63226bc 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -285,14 +285,12 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
 	if (rpwm & PS_ACK) {
 		unsigned long start_time;
 		u8 cpwm_now;
-		u8 poll_cnt = 0;
 
 		start_time = jiffies;
 
 		/*  polling cpwm */
 		do {
 			mdelay(1);
-			poll_cnt++;
 			rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_now);
 			if ((cpwm_orig ^ cpwm_now) & 0x80) {
 				pwrpriv->cpwm = PS_STATE_S4;
-- 
2.25.1


  parent reply	other threads:[~2024-09-12  2:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12  2:25 [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang Ping-Ke Shih
2024-09-12  2:25 ` [PATCH 1/4] staging: rtl8712: remove unused drvinfo_sz from update_recvframe_attrib Ping-Ke Shih
2024-09-12  2:25 ` [PATCH 2/4] staging: rtl8723bs: remove unused efuseValue from efuse_OneByteWrite() Ping-Ke Shih
2024-09-12  2:25 ` [PATCH 3/4] staging: rtl8723bs: remove unused cnt from recv_func() Ping-Ke Shih
2024-09-12  2:25 ` Ping-Ke Shih [this message]
2024-09-12 19:37 ` [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang Philipp Hortmann
2024-09-13  0:32   ` Ping-Ke Shih

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=20240912022522.10715-5-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    /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