Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757031AbcJGSBa (ORCPT ); Fri, 7 Oct 2016 14:01:30 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34786 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755313AbcJGSAl (ORCPT ); Fri, 7 Oct 2016 14:00:41 -0400 From: Ivan Safonov To: Greg Kroah-Hartman , Kyle Kuffermann , Alexey Khoroshilov , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ivan Safonov Subject: [PATCH 29/34] staging:r8188eu: remove free_recvframe_cnt member of recv_priv structure Date: Sat, 8 Oct 2016 01:01:28 +0700 Message-Id: <1475863293-27587-29-git-send-email-insafonov@gmail.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1475863293-27587-1-git-send-email-insafonov@gmail.com> References: <1475863293-27587-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: 3209 Lines: 102 Value of free_recvframe_cnt does not used. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 33 ++-------------------------- drivers/staging/rtl8188eu/include/rtw_recv.h | 1 - 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 1b544e6..b5aeb8d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -66,8 +66,6 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->adapter = padapter; - precvpriv->free_recvframe_cnt = NR_RECVFRAME; - precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(struct recv_frame) + RXFRAME_ALIGN_SZ); if (!precvpriv->pallocated_frame_buf) @@ -119,20 +117,11 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue) { struct recv_frame *hdr; - struct adapter *padapter; - struct recv_priv *precvpriv; hdr = list_first_entry_or_null(&pfree_recv_queue->queue, struct recv_frame, list); - if (hdr) { + if (hdr) list_del_init(&hdr->list); - padapter = hdr->adapter; - if (padapter) { - precvpriv = &padapter->recvpriv; - if (pfree_recv_queue == &precvpriv->free_recv_queue) - precvpriv->free_recvframe_cnt--; - } - } return hdr; } @@ -153,13 +142,8 @@ struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue) int rtw_free_recvframe(struct recv_frame *precvframe, struct __queue *pfree_recv_queue) { - struct adapter *padapter; - struct recv_priv *precvpriv; - if (!precvframe) return _FAIL; - padapter = precvframe->adapter; - precvpriv = &padapter->recvpriv; if (precvframe->pkt) { dev_kfree_skb_any(precvframe->pkt);/* free skb by driver */ precvframe->pkt = NULL; @@ -173,29 +157,16 @@ int rtw_free_recvframe(struct recv_frame *precvframe, list_add_tail(&(precvframe->list), get_list_head(pfree_recv_queue)); - if (padapter != NULL) { - if (pfree_recv_queue == &precvpriv->free_recv_queue) - precvpriv->free_recvframe_cnt++; - } - - spin_unlock_bh(&pfree_recv_queue->lock); + spin_unlock_bh(&pfree_recv_queue->lock); return _SUCCESS; } int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue) { - struct adapter *padapter = precvframe->adapter; - struct recv_priv *precvpriv = &padapter->recvpriv; - list_del_init(&(precvframe->list)); list_add_tail(&(precvframe->list), get_list_head(queue)); - if (padapter != NULL) { - if (queue == &precvpriv->free_recv_queue) - precvpriv->free_recvframe_cnt++; - } - return _SUCCESS; } diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index e95f4f2..40f9728 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -166,7 +166,6 @@ struct recv_priv { struct __queue uc_swdec_pending_queue; u8 *pallocated_frame_buf; u8 *precv_frame_buf; - uint free_recvframe_cnt; struct adapter *adapter; u32 bIsAnyNonBEPkts; u64 rx_bytes; -- 2.7.3