From patchwork Sat Jan 31 15:01:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5754741 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 05D749F336 for ; Sat, 31 Jan 2015 14:58:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C4362026D for ; Sat, 31 Jan 2015 14:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC61C20263 for ; Sat, 31 Jan 2015 14:58:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753862AbbAaO63 (ORCPT ); Sat, 31 Jan 2015 09:58:29 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:40891 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203AbbAaO62 (ORCPT ); Sat, 31 Jan 2015 09:58:28 -0500 Received: by mail-wi0-f179.google.com with SMTP id l15so7616157wiw.0 for ; Sat, 31 Jan 2015 06:58:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pB2UUi0KGy3eWgkdVAQDCFBnjm32GuJqeUVvNd9MNng=; b=S8EOmc8+unXWI950L0d63d64jHLfpEfuJKq+gy6Je10bdwmfV0ckCJvt58sOMs2ika ceL45OW4XZPETF5RsoskUFO/Yx0FsRv+wH3lR0CaclytrcyIo0DrVR1VLuqe2SoRSsvo p2evqTYwWeR82NqLW3Jkl3jiFZu3y66VGM00IQNBACm5r0cBMvPc/ULEECUBy9zNsWva rXn3mTVzZF5KKYdUJ6EwI8koCNO5doj/OeuvCgX4i6Xl+PzjKL8xpHOjoF+UnomNh4bv jsx1adT3oO4V/WUmN7Gudzy8PsryDLovrkC5LdFb2fT2NGoH1F3IxIwv4QBcZoor8iUc riXQ== X-Gm-Message-State: ALoCoQk97eHP6f9PFDmRplT3SkFav31pyZsS5hSe2KZwSCy40QnnlvWwAtUwd1XLSoLsg5DOZr6U X-Received: by 10.181.8.199 with SMTP id dm7mr5258276wid.81.1422716307387; Sat, 31 Jan 2015 06:58:27 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id j1sm19529214wjw.25.2015.01.31.06.58.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Jan 2015 06:58:26 -0800 (PST) From: Rickard Strandqvist To: Larry Finger , Jes Sorensen Cc: Rickard Strandqvist , Greg Kroah-Hartman , Greg Donald , Roberta Dobrescu , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723au: core: rtw_recv: Removed variables that is never used Date: Sat, 31 Jan 2015 16:01:48 +0100 Message-Id: <1422716508-4246-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable was assigned a value that was never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/rtl8723au/core/rtw_recv.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c index 559ddde..6068990 100644 --- a/drivers/staging/rtl8723au/core/rtw_recv.c +++ b/drivers/staging/rtl8723au/core/rtw_recv.c @@ -1561,7 +1561,6 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe) *ptr = 0x87; *(ptr + 1) = 0x12; - eth_type = 0x8712; /* append rx status for mp test packets */ ptr = skb_pull(skb, (hdrlen - sizeof(struct ethhdr) + 2) - 24); @@ -1591,17 +1590,15 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter, struct rtw_queue *defrag_q) { struct list_head *plist, *phead, *ptmp; - u8 *data, wlanhdr_offset; + u8 wlanhdr_offset; u8 curfragnum; struct recv_frame *pnfhdr; - struct recv_frame *prframe, *pnextrframe; - struct rtw_queue *pfree_recv_queue; + struct recv_frame *prframe; struct sk_buff *skb; curfragnum = 0; - pfree_recv_queue = &adapter->recvpriv.free_recv_queue; phead = get_list_head(defrag_q); plist = phead->next; @@ -1622,11 +1619,8 @@ struct recv_frame *recvframe_defrag(struct rtw_adapter *adapter, phead = get_list_head(defrag_q); - data = prframe->pkt->data; - list_for_each_safe(plist, ptmp, phead) { pnfhdr = container_of(plist, struct recv_frame, list); - pnextrframe = (struct recv_frame *)pnfhdr; /* check the fragment sequence (2nd ~n fragment frame) */ if (curfragnum != pnfhdr->attrib.frag_num) { @@ -1684,7 +1678,7 @@ struct recv_frame *recvframe_chk_defrag23a(struct rtw_adapter *padapter, struct sta_priv *pstapriv; struct list_head *phead; struct recv_frame *prtnframe = NULL; - struct rtw_queue *pfree_recv_queue, *pdefrag_q; + struct rtw_queue *pdefrag_q; @@ -1692,8 +1686,6 @@ struct recv_frame *recvframe_chk_defrag23a(struct rtw_adapter *padapter, pfhdr = precv_frame; - pfree_recv_queue = &padapter->recvpriv.free_recv_queue; - /* need to define struct of wlan header frame ctrl */ ismfrag = pfhdr->attrib.mfrag; fragnum = pfhdr->attrib.frag_num; @@ -1798,12 +1790,9 @@ struct recv_frame *recvframe_chk_defrag23a(struct rtw_adapter *padapter, int amsdu_to_msdu(struct rtw_adapter *padapter, struct recv_frame *prframe); int amsdu_to_msdu(struct rtw_adapter *padapter, struct recv_frame *prframe) { - struct rx_pkt_attrib *pattrib; struct sk_buff *skb, *sub_skb; struct sk_buff_head skb_list; - pattrib = &prframe->attrib; - skb = prframe->pkt; skb_pull(skb, prframe->attrib.hdrlen); __skb_queue_head_init(&skb_list); @@ -1921,10 +1910,8 @@ int recv_indicatepkts_in_order(struct rtw_adapter *padapter, struct rx_pkt_attrib *pattrib; /* u8 index = 0; */ int bPktInBuf = false; - struct recv_priv *precvpriv; struct rtw_queue *ppending_recvframe_queue; - precvpriv = &padapter->recvpriv; ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; /* DbgPrint("+recv_indicatepkts_in_order\n"); */