* [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i'
2019-10-06 9:09 [PATCH 0/5] staging/rtl8723bs/core: Remove some set but not used variables zhengbin
@ 2019-10-06 9:09 ` zhengbin
2019-10-07 10:30 ` Greg KH
2019-10-07 14:04 ` Dan Carpenter
2019-10-06 9:09 ` [PATCH 2/5] staging: rtl8723bs: Remove set but not used variable 'tmp_aid' zhengbin
` (3 subsequent siblings)
4 siblings, 2 replies; 8+ messages in thread
From: zhengbin @ 2019-10-06 9:09 UTC (permalink / raw)
To: gregkh, colin.king, hdegoede, hardiksingh.k, devel; +Cc: zhengbin13
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8723bs/core/rtw_xmit.c: In function update_attrib:
drivers/staging/rtl8723bs/core/rtw_xmit.c:680:7: warning: variable i set but not used [-Wunused-but-set-variable]
It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index b5dcb78..c24b524 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -675,7 +675,6 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
{
- uint i;
struct pkt_file pktfile;
struct sta_info *psta = NULL;
struct ethhdr etherhdr;
@@ -689,7 +688,7 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib);
_rtw_open_pktfile(pkt, &pktfile);
- i = _rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
+ (void)_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
pattrib->ether_type = ntohs(etherhdr.h_proto);
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i'
2019-10-06 9:09 ` [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i' zhengbin
@ 2019-10-07 10:30 ` Greg KH
2019-10-07 14:04 ` Dan Carpenter
1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2019-10-07 10:30 UTC (permalink / raw)
To: zhengbin; +Cc: devel, colin.king, hardiksingh.k, hdegoede
On Sun, Oct 06, 2019 at 05:09:55PM +0800, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/staging/rtl8723bs/core/rtw_xmit.c: In function update_attrib:
> drivers/staging/rtl8723bs/core/rtw_xmit.c:680:7: warning: variable i set but not used [-Wunused-but-set-variable]
>
> It is not used since commit 554c0a3abf21 ("staging:
> Add rtl8723bs sdio wifi driver")
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> index b5dcb78..c24b524 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
> @@ -675,7 +675,6 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
>
> static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
> {
> - uint i;
> struct pkt_file pktfile;
> struct sta_info *psta = NULL;
> struct ethhdr etherhdr;
> @@ -689,7 +688,7 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
> DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib);
>
> _rtw_open_pktfile(pkt, &pktfile);
> - i = _rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
> + (void)_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
No need for the (void) marking here. If you really are supposed to do
something with the return value, then do something with it, don't ignore
it.
thanks,
greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i'
2019-10-06 9:09 ` [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i' zhengbin
2019-10-07 10:30 ` Greg KH
@ 2019-10-07 14:04 ` Dan Carpenter
1 sibling, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-10-07 14:04 UTC (permalink / raw)
To: zhengbin; +Cc: devel, gregkh, hdegoede, hardiksingh.k, colin.king
On Sun, Oct 06, 2019 at 05:09:55PM +0800, zhengbin wrote:
> @@ -689,7 +688,7 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
> DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib);
>
> _rtw_open_pktfile(pkt, &pktfile);
> - i = _rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
> + (void)_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
Don't add this "(void)" here. There is no need and it looks ugly.
_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/5] staging: rtl8723bs: Remove set but not used variable 'tmp_aid'
2019-10-06 9:09 [PATCH 0/5] staging/rtl8723bs/core: Remove some set but not used variables zhengbin
2019-10-06 9:09 ` [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i' zhengbin
@ 2019-10-06 9:09 ` zhengbin
2019-10-06 9:09 ` [PATCH 3/5] staging: rtl8723bs: Remove set but not used variable 'prwskeylen' zhengbin
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: zhengbin @ 2019-10-06 9:09 UTC (permalink / raw)
To: gregkh, colin.king, hdegoede, hardiksingh.k, devel; +Cc: zhengbin13
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c: In function rtw_alloc_stainfo:
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c:190:7: warning: variable tmp_aid set but not used [-Wunused-but-set-variable]
It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index bdc52d8..09d2ca3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -187,7 +187,6 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
/* struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr) */
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
{
- uint tmp_aid;
s32 index;
struct list_head *phash_list;
struct sta_info *psta;
@@ -211,8 +210,6 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
/* spin_unlock_bh(&(pfree_sta_queue->lock)); */
- tmp_aid = psta->aid;
-
_rtw_init_stainfo(psta);
psta->padapter = pstapriv->padapter;
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] staging: rtl8723bs: Remove set but not used variable 'prwskeylen'
2019-10-06 9:09 [PATCH 0/5] staging/rtl8723bs/core: Remove some set but not used variables zhengbin
2019-10-06 9:09 ` [PATCH 1/5] staging: rtl8723bs: Remove set but not used variable 'i' zhengbin
2019-10-06 9:09 ` [PATCH 2/5] staging: rtl8723bs: Remove set but not used variable 'tmp_aid' zhengbin
@ 2019-10-06 9:09 ` zhengbin
2019-10-06 9:09 ` [PATCH 4/5] staging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data' zhengbin
2019-10-06 9:09 ` [PATCH 5/5] staging: rtl8723bs: Remove set but not used variable 'adapter' zhengbin
4 siblings, 0 replies; 8+ messages in thread
From: zhengbin @ 2019-10-06 9:09 UTC (permalink / raw)
To: gregkh, colin.king, hdegoede, hardiksingh.k, devel; +Cc: zhengbin13
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_encrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:660:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_decrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:768:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_aes_encrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:1528:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
drivers/staging/rtl8723bs/core/rtw_security.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 5ffaf9b..ed1d854 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -656,7 +656,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
u8 hw_hdr_offset = 0;
struct arc4context mycontext;
sint curfragnum, length;
- u32 prwskeylen;
u8 *pframe, *payload, *iv, *prwskey;
union pn48 dot11txpn;
@@ -703,8 +702,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
/* prwskey =&stainfo->dot118021x_UncstKey.skey[0]; */
prwskey = pattrib->dot118021x_UncstKey.skey;
- prwskeylen = 16;
-
for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
iv = pframe+pattrib->hdrlen;
payload = pframe+pattrib->iv_len+pattrib->hdrlen;
@@ -764,7 +761,6 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
u8 crc[4];
struct arc4context mycontext;
sint length;
- u32 prwskeylen;
u8 *pframe, *payload, *iv, *prwskey;
union pn48 dot11txpn;
@@ -819,10 +815,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
/* DBG_871X("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); */
/* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
- prwskeylen = 16;
} else {
prwskey = &stainfo->dot118021x_UncstKey.skey[0];
- prwskeylen = 16;
}
iv = pframe+prxattrib->hdrlen;
@@ -1524,7 +1518,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
/* Intermediate Buffers */
sint curfragnum, length;
- u32 prwskeylen;
u8 *pframe, *prwskey; /* *payload,*iv */
u8 hw_hdr_offset = 0;
/* struct sta_info *stainfo = NULL; */
@@ -1551,8 +1544,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
/* prwskey =&stainfo->dot118021x_UncstKey.skey[0]; */
prwskey = pattrib->dot118021x_UncstKey.skey;
- prwskeylen = 16;
-
for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
if ((curfragnum+1) == pattrib->nr_frags) { /* 4 the last fragment */
length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] staging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data'
2019-10-06 9:09 [PATCH 0/5] staging/rtl8723bs/core: Remove some set but not used variables zhengbin
` (2 preceding siblings ...)
2019-10-06 9:09 ` [PATCH 3/5] staging: rtl8723bs: Remove set but not used variable 'prwskeylen' zhengbin
@ 2019-10-06 9:09 ` zhengbin
2019-10-06 9:09 ` [PATCH 5/5] staging: rtl8723bs: Remove set but not used variable 'adapter' zhengbin
4 siblings, 0 replies; 8+ messages in thread
From: zhengbin @ 2019-10-06 9:09 UTC (permalink / raw)
To: gregkh, colin.king, hdegoede, hardiksingh.k, devel; +Cc: zhengbin13
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8723bs/core/rtw_recv.c: In function validate_80211w_mgmt:
drivers/staging/rtl8723bs/core/rtw_recv.c:1415:8: warning: variable ppp set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c: In function validate_80211w_mgmt:
drivers/staging/rtl8723bs/core/rtw_recv.c:1403:5: warning: variable type set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c: In function recvframe_defrag:
drivers/staging/rtl8723bs/core/rtw_recv.c:1713:6: warning: variable data set but not used [-Wunused-but-set-variable]
They are not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 687ff3c..7fa8c84 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1400,10 +1400,8 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
u8 *ptr = precv_frame->u.hdr.rx_data;
- u8 type;
u8 subtype;
- type = GetFrameType(ptr);
subtype = GetFrameSubType(ptr); /* bit(7)~bit(2) */
/* only support station mode */
@@ -1412,9 +1410,8 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
/* unicast management frame decrypt */
if (pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) {
- u8 *ppp, *mgmt_DATA;
+ u8 *mgmt_DATA;
u32 data_len = 0;
- ppp = GetAddr2Ptr(ptr);
pattrib->bdecrypted = 0;
pattrib->encrypt = _AES_;
@@ -1709,7 +1706,7 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter,
struct __queue *defrag_q)
{
struct list_head *plist, *phead;
- u8 *data, wlanhdr_offset;
+ u8 wlanhdr_offset;
u8 curfragnum;
struct recv_frame_hdr *pfhdr, *pnfhdr;
union recv_frame *prframe, *pnextrframe;
@@ -1739,8 +1736,6 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter,
plist = get_next(plist);
- data = get_recvframe_data(prframe);
-
while (phead != plist) {
pnextrframe = (union recv_frame *)plist;
pnfhdr = &pnextrframe->u.hdr;
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] staging: rtl8723bs: Remove set but not used variable 'adapter'
2019-10-06 9:09 [PATCH 0/5] staging/rtl8723bs/core: Remove some set but not used variables zhengbin
` (3 preceding siblings ...)
2019-10-06 9:09 ` [PATCH 4/5] staging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data' zhengbin
@ 2019-10-06 9:09 ` zhengbin
4 siblings, 0 replies; 8+ messages in thread
From: zhengbin @ 2019-10-06 9:09 UTC (permalink / raw)
To: gregkh, colin.king, hdegoede, hardiksingh.k, devel; +Cc: zhengbin13
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/staging/rtl8723bs/core/rtw_mlme.c: In function rtw_select_roaming_candidate:
drivers/staging/rtl8723bs/core/rtw_mlme.c:2007:18: warning: variable adapter set but not used [-Wunused-but-set-variable]
It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 4000125..0ac7712 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1989,7 +1989,6 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
{
int ret = _FAIL;
struct list_head *phead;
- struct adapter *adapter;
struct __queue *queue = &(mlme->scanned_queue);
struct wlan_network *pnetwork = NULL;
struct wlan_network *candidate = NULL;
@@ -2001,7 +2000,6 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
spin_lock_bh(&(mlme->scanned_queue.lock));
phead = get_list_head(queue);
- adapter = (struct adapter *)mlme->nic_hdl;
mlme->pscanned = get_next(phead);
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread