Skip to contentSkip to conversation

staging: rtl8723bs: remove redundant assignments to res

PATCH In review Hungyu Lin 2 participants 2 messages Apr 4 Staging

lore
Share & tools
lore

Hungyu Lin

author
#0 lore raw

PATCH 1/1 staging: rtl8723bs: remove redundant assignments to res

The variable res is already equal to _FAIL when the condition (res == _FAIL) is true. The assignments inside the if blocks are redundant and can be removed.

No functional change.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +2 -6
index 7b18be8912e6..ea1923023caa 100644
@@ -209,10 +209,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		pxmitbuf->buf_tag = XMITBUF_MGNT;
 
 		res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, true);
-		if (res == _FAIL) {
-			res = _FAIL;
+		if (res == _FAIL)
 			goto exit;
-		}
 
 		pxmitbuf->phead = pxmitbuf->pbuf;
 		pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ;
@@ -241,10 +239,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 			res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf,
 							 MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ,
 							 true);
-			if (res == _FAIL) {
-				res = _FAIL;
+			if (res == _FAIL)
 				goto exit;
-			}
 
 			pxmitbuf->phead = pxmitbuf->pbuf;
 			pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 16 lines · Hungyu Lin

The variable res is already equal to _FAIL when the condition (res == _FAIL) is true. The assignments inside the if blocks are redundant and can be removed.

No functional change.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -0
index 7b18be8912e6..ea1923023caa 100644

drivers/staging/rtl8723bs/core/rtw_xmit.c s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · line 215

Quoted 8 lines
drivers/staging/rtl8723bs/core/rtw_xmit.c +1 -3
@@ -209,10 +209,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 		pxmitbuf->buf_tag = XMITBUF_MGNT;
 
 		res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, true);
-		if (res == _FAIL) {
-			res = _FAIL;
+		if (res == _FAIL)
 			goto exit;
-		}

Thanks, but it'd be much more useful if these "_SUCCESS" and "_FAIL" macros where entirely removed instead of trying to clean up this bad style.

Thanks,

ET