Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp618617img; Wed, 20 Mar 2019 07:30:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXGZj0YY9Mm430b5fqTm9+VYAPddeeO5LyQdkMlhK71WBaVWNoN2tDm9g70gjzILE7eD70 X-Received: by 2002:a63:cd02:: with SMTP id i2mr28795436pgg.111.1553092249022; Wed, 20 Mar 2019 07:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553092249; cv=none; d=google.com; s=arc-20160816; b=uaEOfFY7tj6V5b477rSCR8QrWOS95YGLtbThNTCNs9Bj1IiX02IdWmmGkNXGsSWreu wfg56VaOm1APHD+dH7aZj4phFAMPw5DbUMmHgfAQ0ATupU4U3ybVSqu6UWTEFah6d1Te Cle/b8VByFGN+SHHEYQ5gzkILhKmc55CrGzw1jbpVinqcyHBJQeYYHz112L36fJXFK3x uPYb0O2qJlj/y+SbgfqXxfMXqntlk9RB6e9g95Km5pyKDfo7nSmhQfmfnXfK4/8pNiCe K1TVCKKTvDmd3WWu6FikBvS01GvYTRXoQ8tyOLQLXPKJwmW7gc/TK5ubC9n4pnUs23vc r97Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OWJECjfMNPeLEisMY9HoUOhxK8huQ3dZk/QSLy3zcFM=; b=BMVrhsqn9aiAZvOW8ErDuaDMfBIWlNonCenQoy1tWM3ka93fbLS7MH9jAxwLW85s9E LzbVXO6QsqpB7FN1+gJMfiu+ZdxibJIwhnOZ5H3TcTpgBCRBTbU/QZQgA5TZvJK2VTKf DULo2hwqMLG6tu9nYc0jrfsphsVLCrkYSsKoiLMLyoF1Ba+BTDfSW302IuLBu+W1vxOR ICHr/vsm6akjlQdWFI8WQbHH5gk90N2pW6sdpp+RkgyCA84pJiYCmM8FJeA41ckXgi6K sBUAW2McxNnxuBpC+rwGYCPPNGCqH7BjZQGMvxKAGPWMMuJ7ztfH5dJLonsj1VqOfM/K /3mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KYZESArF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si1923002plq.328.2019.03.20.07.30.27; Wed, 20 Mar 2019 07:30:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KYZESArF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727680AbfCTO3q (ORCPT + 99 others); Wed, 20 Mar 2019 10:29:46 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43524 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726824AbfCTO3q (ORCPT ); Wed, 20 Mar 2019 10:29:46 -0400 Received: by mail-lj1-f193.google.com with SMTP id f18so2298941lja.10 for ; Wed, 20 Mar 2019 07:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OWJECjfMNPeLEisMY9HoUOhxK8huQ3dZk/QSLy3zcFM=; b=KYZESArFWhLE6UL34WXkKjp6FlX7SRTOscsE2pkAucvzVeAxuQF2o2EYijMSdknjkT foW183YRsZrc5z98e+4ptjoWl/Y1XDAd3YBz9S0VecihwLcRnw8emhooc5iRruhfZf8X dSryYAxVC+j/j4eQ16q3Qk0dUGePGGYg2XIpj5dsCERjfK+zZlnYedRAojVRA/vHs28d 0PQ41F8/FlRKn1fn6oO0DBl/3MrXZTYggNnoDqxruWSTTf1oO6Vzw4Wgle82sbl61pd2 B+Gm9MmeaDGTXcY37oiTzFe1+WBxFgxqMAM2a2Fe7siLzSGEVUxehrEopsxXDfTkKoh6 K+Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OWJECjfMNPeLEisMY9HoUOhxK8huQ3dZk/QSLy3zcFM=; b=Os/1us6sRKhpWkXqOP/SKzKPRBeFMGwByupbKUUqfMOOzalrw+srieGFnn7NGLlzd9 UUFxU8gWTTi+LTvKmbf+iTRsG7M41beWxF6f09J6eeqNhI3T4nPckEMu2BTrT7/usbQA ou/SxfvOqnCY33qI6PwuDHx0pHfkONgQgKLrSd0448+YUkfw3Umo4sIapDw8oy6d33jW YNK0xgvXZvX1I1AZ4Bcm3E07ULT8kiCeWNMkXvKi+y1xMctbNPNI104xgjmXz7VtGoE6 lgPWnDi/OlUK/BztsPWUgLxgmawW+1Z0knrtjig6sYkoshEMG1a0YwlLwWWN6LNh4F/9 elbQ== X-Gm-Message-State: APjAAAVeD/JMiRcpmro1Um+vOJ525MsSYIf3dtsUFGV3SIEjqU/8oYra m9TXaiu4YV1XIyGZze5ntwg= X-Received: by 2002:a2e:884a:: with SMTP id z10mr7955873ljj.21.1553092184336; Wed, 20 Mar 2019 07:29:44 -0700 (PDT) Received: from alpha ([178.71.210.108]) by smtp.gmail.com with ESMTPSA id q3sm398391lff.23.2019.03.20.07.29.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 07:29:43 -0700 (PDT) Received: (nullmailer pid 17708 invoked by uid 1000); Wed, 20 Mar 2019 14:32:18 -0000 From: Ivan Safonov To: Larry Finger Cc: Greg Kroah-Hartman , Michael Straube , Hans de Goede , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Ivan Safonov Subject: [PATCH] staging: r8188eu: refactor recvframe_defrag() Date: Wed, 20 Mar 2019 17:31:44 +0300 Message-Id: <20190320143144.17663-1-insafonov@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Local variables pfhdr and prframe always have a same value, so one of them is unnecessary. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 90eb1a025051..9075e3a2755a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1325,7 +1325,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, struct list_head *plist, *phead; u8 wlanhdr_offset; u8 curfragnum; - struct recv_frame *pfhdr, *pnfhdr; + struct recv_frame *pnfhdr; struct recv_frame *prframe, *pnextrframe; struct __queue *pfree_recv_queue; @@ -1334,11 +1334,10 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, phead = get_list_head(defrag_q); plist = phead->next; - pfhdr = list_entry(plist, struct recv_frame, list); - prframe = pfhdr; + prframe = list_entry(plist, struct recv_frame, list); list_del_init(&prframe->list); - if (curfragnum != pfhdr->attrib.frag_num) { + if (curfragnum != prframe->attrib.frag_num) { /* the first fragment number must be 0 */ /* free the whole queue */ rtw_free_recvframe(prframe, pfree_recv_queue); @@ -1377,15 +1376,15 @@ 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) */ - skb_trim(prframe->pkt, prframe->pkt->len - pfhdr->attrib.icv_len); + skb_trim(prframe->pkt, prframe->pkt->len - prframe->attrib.icv_len); /* memcpy */ - memcpy(skb_tail_pointer(pfhdr->pkt), pnfhdr->pkt->data, + memcpy(skb_tail_pointer(prframe->pkt), pnfhdr->pkt->data, pnfhdr->pkt->len); skb_put(prframe->pkt, pnfhdr->pkt->len); - pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len; + prframe->attrib.icv_len = pnfhdr->attrib.icv_len; plist = plist->next; } -- 2.19.2