Commit b33f56a1 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: rtl8723bs: hal: remove redundant variable n

The variable n is being assigned a value that is never read inside
an if statement block, the assignment is redundant and can be removed.
With this removed, n is only being used for a constant loop bounds
check, so replace n with that value instead and remove n completely.

Addresses-Coverity: ("Unused value")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>

Link: https://lore.kernel.org/r/20190905152227.4610-1-colin.king@canonical.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f0c7686d
...@@ -502,7 +502,7 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter) ...@@ -502,7 +502,7 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
*/ */
void rtl8723bs_free_recv_priv(struct adapter *padapter) void rtl8723bs_free_recv_priv(struct adapter *padapter)
{ {
u32 i, n; u32 i;
struct recv_priv *precvpriv; struct recv_priv *precvpriv;
struct recv_buf *precvbuf; struct recv_buf *precvbuf;
...@@ -514,9 +514,8 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter) ...@@ -514,9 +514,8 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter)
/* 3 2. free all recv buffers */ /* 3 2. free all recv buffers */
precvbuf = (struct recv_buf *)precvpriv->precv_buf; precvbuf = (struct recv_buf *)precvpriv->precv_buf;
if (precvbuf) { if (precvbuf) {
n = NR_RECVBUFF;
precvpriv->free_recv_buf_queue_cnt = 0; precvpriv->free_recv_buf_queue_cnt = 0;
for (i = 0; i < n ; i++) { for (i = 0; i < NR_RECVBUFF; i++) {
list_del_init(&precvbuf->list); list_del_init(&precvbuf->list);
rtw_os_recvbuf_resource_free(padapter, precvbuf); rtw_os_recvbuf_resource_free(padapter, precvbuf);
precvbuf++; precvbuf++;
...@@ -525,7 +524,6 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter) ...@@ -525,7 +524,6 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter)
} }
if (precvpriv->pallocated_recv_buf) { if (precvpriv->pallocated_recv_buf) {
n = NR_RECVBUFF * sizeof(struct recv_buf) + 4;
kfree(precvpriv->pallocated_recv_buf); kfree(precvpriv->pallocated_recv_buf);
precvpriv->pallocated_recv_buf = NULL; precvpriv->pallocated_recv_buf = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment