Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944978AbcJSP0k (ORCPT ); Wed, 19 Oct 2016 11:26:40 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36850 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941091AbcJSPFs (ORCPT ); Wed, 19 Oct 2016 11:05:48 -0400 From: Ivan Safonov To: Greg Kroah-Hartman , Bhaktipriya Shridhar , Andy Shevchenko , Geliang Tang , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: insafonov@gmail.com Subject: [PATCH 28/37] staging:r8188eu: remove recvframe_pull_tail function Date: Wed, 19 Oct 2016 22:07:56 +0700 Message-Id: <1476889685-7367-28-git-send-email-insafonov@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1476889685-7367-1-git-send-email-insafonov@gmail.com> References: <1476889685-7367-1-git-send-email-insafonov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2590 Lines: 70 skb_trim used instead. Signed-off-by: Ivan Safonov --- 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