* [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang
@ 2024-09-12 2:25 Ping-Ke Shih
2024-09-12 2:25 ` [PATCH 1/4] staging: rtl8712: remove unused drvinfo_sz from update_recvframe_attrib Ping-Ke Shih
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2024-09-12 2:25 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging
The build of wireless-next pull-request using clang report warnings [1].
Fix them accordingly.
[1] https://lore.kernel.org/linux-wireless/172609384625.1065358.6518424528532813444.git-patchwork-notify@kernel.org/T/#m405a10ad637bfc5f337127bab81336d8569e49cd
Ping-Ke Shih (4):
staging: rtl8712: remove unused drvinfo_sz from
update_recvframe_attrib
staging: rtl8723bs: remove unused efuseValue from efuse_OneByteWrite()
staging: rtl8723bs: remove unused cnt from recv_func()
staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm()
drivers/staging/rtl8712/rtl8712_recv.c | 4 ----
drivers/staging/rtl8723bs/core/rtw_efuse.c | 9 ---------
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 --
drivers/staging/rtl8723bs/core/rtw_recv.c | 5 +----
4 files changed, 1 insertion(+), 19 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] staging: rtl8712: remove unused drvinfo_sz from update_recvframe_attrib
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 ` Ping-Ke Shih
2024-09-12 2:25 ` [PATCH 2/4] staging: rtl8723bs: remove unused efuseValue from efuse_OneByteWrite() Ping-Ke Shih
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2024-09-12 2:25 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging
The drvinfo_sz is a size of hardware generated data putting in front of
real RX data. The functions r8712_rxcmd_event_hdl() and recvbuf2recvframe()
have its own parsing code to get drvinfo_sz to access real RX data, so
removing this unused drvinfo_sz is safe.
Otherwise, clang report:
rtl8712_recv.c:139:6: warning:
variable 'drvinfo_sz' set but not used [-Wunused-but-set-variable]
139 | u16 drvinfo_sz;
| ^
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/staging/rtl8712/rtl8712_recv.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index 1fabc5137a4c..ab344d676bb9 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -136,10 +136,6 @@ void r8712_free_recvframe(union recv_frame *precvframe,
static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib,
struct recv_stat *prxstat)
{
- u16 drvinfo_sz;
-
- drvinfo_sz = (le32_to_cpu(prxstat->rxdw0) & 0x000f0000) >> 16;
- drvinfo_sz <<= 3;
/*TODO:
* Offset 0
*/
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] staging: rtl8723bs: remove unused efuseValue from efuse_OneByteWrite()
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 ` Ping-Ke Shih
2024-09-12 2:25 ` [PATCH 3/4] staging: rtl8723bs: remove unused cnt from recv_func() Ping-Ke Shih
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2024-09-12 2:25 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging
The efuseValue is to store value from register EFUSE_CTRL, and set control
bits including address and write bit. This is no need for RTL8723BS, so
the consumer has been removed. Thus, remove these unused codes are safe.
Otherwiese, clang warns:
rtw_efuse.c:285:6: warning:
variable 'efuseValue' set but not used [-Wunused-but-set-variable]
285 | u32 efuseValue;
| ^
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/staging/rtl8723bs/core/rtw_efuse.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c
index eb848f9bbf2c..cf8485a3ac00 100644
--- a/drivers/staging/rtl8723bs/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c
@@ -282,22 +282,13 @@ u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoT
{
u8 tmpidx = 0;
u8 bResult = false;
- u32 efuseValue;
if (bPseudoTest)
return Efuse_Write1ByteToFakeContent(addr, data);
-
/* -----------------e-fuse reg ctrl --------------------------------- */
/* address */
-
- efuseValue = rtw_read32(padapter, EFUSE_CTRL);
- efuseValue |= (BIT21|BIT31);
- efuseValue &= ~(0x3FFFF);
- efuseValue |= ((addr<<8 | data) & 0x3FFFF);
-
-
/* <20130227, Kordan> 8192E MP chip A-cut had better not set 0x34[11] until B-Cut. */
/* <20130121, Kordan> For SMIC EFUSE specificatoin. */
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] staging: rtl8723bs: remove unused cnt from recv_func()
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 ` Ping-Ke Shih
2024-09-12 2:25 ` [PATCH 4/4] staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm() Ping-Ke Shih
2024-09-12 19:37 ` [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang Philipp Hortmann
4 siblings, 0 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2024-09-12 2:25 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging
The 'cnt' is used to show how many pending frames are processed, and the
debug code has been removed, so removing 'cnt' is safe.
Otherwise, clang warns:
core/rtw_recv.c:2030:7: warning:
variable 'cnt' set but not used [-Wunused-but-set-variable]
2030 | int cnt = 0;
| ^
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 0eadc23a7d54..915d63892c93 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -2027,12 +2027,9 @@ static int recv_func(struct adapter *padapter, union recv_frame *rframe)
/* check if need to handle uc_swdec_pending_queue*/
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && psecuritypriv->busetkipkey) {
union recv_frame *pending_frame;
- int cnt = 0;
- while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) {
- cnt++;
+ while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue)))
recv_func_posthandle(padapter, pending_frame);
- }
}
ret = recv_func_prehandle(padapter, rframe);
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm()
2024-09-12 2:25 [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang Ping-Ke Shih
` (2 preceding siblings ...)
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
2024-09-12 19:37 ` [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang Philipp Hortmann
4 siblings, 0 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2024-09-12 2:25 UTC (permalink / raw)
To: gregkh; +Cc: linux-staging
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang
2024-09-12 2:25 [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang Ping-Ke Shih
` (3 preceding siblings ...)
2024-09-12 2:25 ` [PATCH 4/4] staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm() Ping-Ke Shih
@ 2024-09-12 19:37 ` Philipp Hortmann
2024-09-13 0:32 ` Ping-Ke Shih
4 siblings, 1 reply; 7+ messages in thread
From: Philipp Hortmann @ 2024-09-12 19:37 UTC (permalink / raw)
To: Ping-Ke Shih, gregkh; +Cc: linux-staging
On 9/12/24 04:25, Ping-Ke Shih wrote:
> The build of wireless-next pull-request using clang report warnings [1].
> Fix them accordingly.
>
> [1] https://lore.kernel.org/linux-wireless/172609384625.1065358.6518424528532813444.git-patchwork-notify@kernel.org/T/#m405a10ad637bfc5f337127bab81336d8569e49cd
>
> Ping-Ke Shih (4):
> staging: rtl8712: remove unused drvinfo_sz from
> update_recvframe_attrib
> staging: rtl8723bs: remove unused efuseValue from efuse_OneByteWrite()
> staging: rtl8723bs: remove unused cnt from recv_func()
> staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm()
>
> drivers/staging/rtl8712/rtl8712_recv.c | 4 ----
> drivers/staging/rtl8723bs/core/rtw_efuse.c | 9 ---------
> drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 --
> drivers/staging/rtl8723bs/core/rtw_recv.c | 5 +----
> 4 files changed, 1 insertion(+), 19 deletions(-)
>
Hi Ping-Ke,
I cannot apply your 2nd patch. Please consider to rebase.
Thanks for your support.
Bye Philipp
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 0/4] staging: fix warning of -Wunused-but-set-variable reported by clang
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
0 siblings, 0 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2024-09-13 0:32 UTC (permalink / raw)
To: Philipp Hortmann, gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev
>
> I cannot apply your 2nd patch. Please consider to rebase.
>
Rebased on top of staging tree by v2 [1]. Thanks.
[1] https://lore.kernel.org/linux-staging/20240913002815.5149-1-pkshih@realtek.com/T/#t
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-09-13 0:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 4/4] staging: rtl8723bs: remove unused 'poll_cnt' from rtw_set_rpwm() Ping-Ke Shih
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox