staging: rtl8723bs: simplify rtw_free_xmitframe()
PATCH 1/1 staging: rtl8723bs: simplify rtw_free_xmitframe()
rtw_free_xmitframe() always returns _SUCCESS and the return value is not used by its callers.
Convert the function to return void and remove the redundant _SUCCESS return value. Also replace the goto used to skip the xmit frame queue handling with an early return.
Signed-off-by Hungyu Lin <[email protected]>
--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 14 +++++++------- drivers/staging/rtl8723bs/include/rtw_xmit.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +7 -7
@@ -1734,14 +1734,14 @@ struct xmit_frame *rtw_alloc_xmitframe_once(struct xmit_priv *pxmitpriv)return pxframe; } -s32 rtw_free_xmitframe (struct xmit_priv *pxmitpriv,struct xmit_frame *pxmitframe) +void rtw_free_xmitframe (struct xmit_priv *pxmitpriv,struct xmit_frame *pxmitframe) {struct __queue *queue =NULL ;struct adapter *padapter = pxmitpriv->adapter;struct sk_buff *pndis_pkt =NULL ;if (!pxmitframe) -return _SUCCESS; +return ;if (pxmitframe->pkt) { pndis_pkt = pxmitframe->pkt;
@@ -1750,7 +1750,11 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframif (pxmitframe->alloc_addr) {kfree (pxmitframe->alloc_addr); - goto check_pkt_complete; + +if (pndis_pkt) +rtw_os_pkt_complete (padapter, pndis_pkt); + +return ; }if (pxmitframe->ext_tag ==0 )
@@ -1769,12 +1773,8 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitframspin_unlock_bh (&queue->lock); -check_pkt_complete: -if (pndis_pkt)rtw_os_pkt_complete (padapter, pndis_pkt); - -return _SUCCESS; }void rtw_free_xmitframe_queue (struct xmit_priv *pxmitpriv,struct __queue *pframequeue)
drivers/staging/rtl8723bs/include/rtw_xmit.h +1 -1
@@ -416,7 +416,7 @@ extern s32 rtw_put_snap(u8 *data, u16 h_proto);extern struct xmit_frame *rtw_alloc_xmitframe (struct xmit_priv *pxmitpriv);struct xmit_frame *rtw_alloc_xmitframe_ext (struct xmit_priv *pxmitpriv);struct xmit_frame *rtw_alloc_xmitframe_once (struct xmit_priv *pxmitpriv); -extern s32 rtw_free_xmitframe (struct xmit_priv *pxmitpriv,struct xmit_frame *pxmitframe); +void rtw_free_xmitframe (struct xmit_priv *pxmitpriv,struct xmit_frame *pxmitframe);extern void rtw_free_xmitframe_queue (struct xmit_priv *pxmitpriv,struct __queue *pframequeue);struct tx_servq *rtw_get_sta_pending (struct adapter *padapter,struct sta_info *psta,signed int up,u8 *ac);int rtw_xmitframe_enqueue (struct adapter *padapter,struct xmit_frame *pxmitframe);
Signature · 1 line
2.43.0