[PATCH 01/10] staging: rtl8712: amsdu_to_msdu(): Change return type

Nishka Dasgupta nishkadg.linux at gmail.com
Thu Aug 8 06:40:03 UTC 2019


Change return type of amsdu_to_msdu from int to void as it always
returns _SUCCESS. Remove return statement as well.
As this return value was never anything other than _SUCCESS, remove the
if-branch that depends on the return value not being _SUCCESS.
Remove local variable that was only used in the now-removed if-branch
Modify call site to call the function amsdu_to_msdu without expecting
a return value.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/rtl8712_recv.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index eb9a4a5ed740..42372e7e76ac 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -318,7 +318,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter,
 	return prtnframe;
 }
 
-static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe)
+static void amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe)
 {
 	int	a_len, padding_len;
 	u16	eth_type, nSubframe_Length;
@@ -416,7 +416,6 @@ static int amsdu_to_msdu(struct _adapter *padapter, union recv_frame *prframe)
 exit:
 	prframe->u.hdr.len = 0;
 	r8712_free_recvframe(prframe, pfree_recv_queue);
-	return _SUCCESS;
 }
 
 void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf)
@@ -506,7 +505,6 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
 	union recv_frame *prframe;
 	struct rx_pkt_attrib *pattrib;
 	int bPktInBuf = false;
-	struct recv_priv *precvpriv = &padapter->recvpriv;
 	struct  __queue *ppending_recvframe_queue =
 			 &preorder_ctrl->pending_recvframe_queue;
 
@@ -543,10 +541,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
 							       prframe);
 				}
 			} else if (pattrib->amsdu == 1) {
-				if (amsdu_to_msdu(padapter, prframe) !=
-				    _SUCCESS)
-					r8712_free_recvframe(prframe,
-						   &precvpriv->free_recv_queue);
+				amsdu_to_msdu(padapter, prframe);
 			}
 			/* Update local variables. */
 			bPktInBuf = false;
-- 
2.19.1



More information about the devel mailing list