Skip to contentSkip to conversation

staging: rtl8723bs: core: Remove unused but set variable

PATCH In review Fabio M. De Francesco 2 participants 3 messages Apr 13, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: core: Remove unused but set variable

Removed "ledBlink_param" because it was set to the value of "pbuf" but was never reused. This set was made by direct assignment (no helper had been called), therefore it had no side effect to the location pointed by "pbuf".

---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -2
index f19a15a3924b..440e22922106 100644
@@ -6191,12 +6191,10 @@ u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf)
 
 u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
-	struct LedBlink_param *ledBlink_param;
 
 	if (!pbuf)
 		return H2C_PARAMETERS_ERROR;
 
-	ledBlink_param = (struct LedBlink_param *)pbuf;
 	return	H2C_SUCCESS;
 }
 
Signature · 1 line
2.31.1
#1 lore raw
Quoted 15 lines · Fabio M. De Francesco

Removed "ledBlink_param" because it was set to the value of "pbuf" but was never reused. This set was made by direct assignment (no helper had been called), therefore it had no side effect to the location pointed by "pbuf".

---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -0
index f19a15a3924b..440e22922106 100644
@@ -6191,12 +6191,10 @@ u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf)
 

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf) · line 6199

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -2
 u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
-	struct LedBlink_param *ledBlink_param;
 
 	if (!pbuf)
 		return H2C_PARAMETERS_ERROR;
 
-	ledBlink_param = (struct LedBlink_param *)pbuf;
 	return	H2C_SUCCESS;
 }

Is this function actually useful?

julia

#2 lore raw
Quoted 30 lines · CEST Julia Lawall
Quoted 29 lines · Fabio M. De Francesco

Removed "ledBlink_param" because it was set to the value of "pbuf" but was never reused. This set was made by direct assignment (no helper had been called), therefore it had no side effect to the location pointed by "pbuf".

---

 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 --
 1 file changed, 2 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index f19a15a3924b..440e22922106 100644

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -0
@@ -6191,12 +6191,10 @@ u8 set_chplan_hdl(struct adapter *padapter,

unsigned char *pbuf)>
u8 led_blink_hdl(struct adapter *padapter, unsigned char *pbuf) {

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -2
-	struct LedBlink_param *ledBlink_param;
 
 	if (!pbuf)
 
 		return H2C_PARAMETERS_ERROR;
 
-	ledBlink_param = (struct LedBlink_param *)pbuf;
Quoted 8 lines
Quoted 3 lines

return H2C_SUCCESS;

}

Is this function actually useful?

julia

Actually, it is completely useless.
We should ask the original authors for explanations :)

I'm about to grep the whole driver for the purpose to check if there are callers elsewhere and then delete any call and the function itself.

Thanks,

Fabio