[PATCH 28/37] staging:r8188eu: remove recvframe_pull_tail function

From: Ivan Safonov
Date: Wed Oct 19 2016 - 11:26:43 EST


skb_trim used instead.

Signed-off-by: Ivan Safonov <insafonov@xxxxxxxxx>
---
drivers/staging/rtl8188eu/core/rtw_recv.c | 8 +++++---
drivers/staging/rtl8188eu/include/rtw_recv.h | 16 ----------------
2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 3f7812f..c07a3f5 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -349,7 +349,7 @@ static int recvframe_chkmic(struct adapter *adapter,
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic: rtw_get_stainfo==NULL!!!\n"));
}

- recvframe_pull_tail(precvframe, 8);
+ skb_trim(precvframe->pkt, precvframe->pkt->len - 8);
}

exit:
@@ -1277,7 +1277,8 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe)
struct rx_pkt_attrib *pattrib = &precvframe->attrib;

if (pattrib->encrypt)
- recvframe_pull_tail(precvframe, pattrib->icv_len);
+ skb_trim(precvframe->pkt,
+ precvframe->pkt->len - pattrib->icv_len);

psnap = (struct ieee80211_snap_hdr *)(ptr+pattrib->hdrlen + pattrib->iv_len);
psnap_type = ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
@@ -1375,7 +1376,8 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
skb_pull(pnextrframe->pkt, wlanhdr_offset);

/* append to first fragment frame's tail (if privacy frame, pull the ICV) */
- recvframe_pull_tail(prframe, pfhdr->attrib.icv_len);
+ skb_trim(prframe->pkt,
+ prframe->pkt->len - pfhdr->attrib.icv_len);

/* memcpy */
memcpy(pfhdr->pkt->tail, pnfhdr->pkt->data, pnfhdr->pkt->len);
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h
index 5357a8d..cacf35c 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -253,22 +253,6 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);

void rtw_reordering_ctrl_timeout_handler(unsigned long data);

-static inline void recvframe_pull_tail(struct recv_frame *precvframe, uint sz)
-{
- /* rmv data from rx_tail (by yitsen) */
-
- /* used for extract sz bytes from rx_end, update rx_end and return
- * the updated rx_end to the caller */
- /* after pulling, rx_end must be still larger than rx_data. */
-
- if (precvframe == NULL)
- return;
-
- if (precvframe->pkt->len < sz)
- return;
- skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
-}
-
static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
{
s32 power; /* in dBm. */
--
2.7.3