Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3428421ybl; Sun, 1 Sep 2019 12:52:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxShrydw2YWL2PT55l5Pf8D9F+R+hbJRGtLnxqAOr6WyRBQCiZZa2Geavzwm3pyUrcASLof X-Received: by 2002:a63:d64f:: with SMTP id d15mr6590145pgj.345.1567367526114; Sun, 01 Sep 2019 12:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567367526; cv=none; d=google.com; s=arc-20160816; b=axuwN1j4YZpM1+b9IzHfdcd3NR+HdWTbQN1O0MgDFyPNF2wAQQla2i6b0vOZrcUxDz 0bdkQ/JU6WbNRf3SL+88MCPZSbxUKlscMOFWyU498UYUScAHtnHrdIJVlIxg+kqpUGzX PACjTt+6kHbCjhhQODFtsX1s2tBUN0cTMJwErKF373QrMzfymUw1HDaK0LcQ9nsH1fEo 2p8zBQNOEfWP/gOMDY3AvbsqLWNh3cQ4m+bHkzuAu13wld39skI/JtrFuLRiQdDAbLow yRvEZH49VMBs+UOhIKjCbKWugz1PGlF5IxrLkbFUh4vF7XtMcypwiuzHnuEi/K35ZKOL qCTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=LwY5pl2zHPQpHCPl2EeMGMDJCM7CTQzDe7kSoMux6Pc=; b=UncPnhmOCXZoff/u74JZQQi8Fn/6FvtumLLOX/2fDPsHKiCqhCXQ63z1iskMC0Kab4 35oJFHk1fLAMTH77oUm8cfq0BrSA0vtzTrumykNPiri7pLulwkaiFRBXd9i+RW29Rtrl D1VV6auzRw9VgtQxn/TcI+uZh6NKRMDPpUyq91kLzqnuaxtPy0z9km5cYoQZbS88tF8S D0Ku56mJp2pWlKjxgJN3BodX2A515mnx36vTTP8/BZ6cNqzBGoIram7Qhs9+B/u3UOSS wV6c++2mDOT3cmE/RKcbm7obMZDNbzk0aMBSFA3sBGtP6YRBs7YsVuzex0pT+TOV+Aqt I8wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D7DAJ36E; 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 y5si6791938pjp.4.2019.09.01.12.51.51; Sun, 01 Sep 2019 12:52:06 -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=D7DAJ36E; 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 S1728964AbfIATtk (ORCPT + 99 others); Sun, 1 Sep 2019 15:49:40 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33925 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728506AbfIATtk (ORCPT ); Sun, 1 Sep 2019 15:49:40 -0400 Received: by mail-lf1-f66.google.com with SMTP id z21so8933526lfe.1 for ; Sun, 01 Sep 2019 12:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=LwY5pl2zHPQpHCPl2EeMGMDJCM7CTQzDe7kSoMux6Pc=; b=D7DAJ36EbdYDxjCfKvTRc5FxFRgj+oFbazv3GDtCNFtYxKlbTFNHIXy1C53fDuR1sM qNZiJUn1bx0kB1nW5HFFnHIsVO5sGJ8p6WqE3pyfB3mT4rkUFH/PDik4Kt1tPxxEHf1l mVHY2tYxpiYPeki/NSg9s8/9l1gUSe8azuX7C4yQ4EuHrnNuxardH5aK/nVjkg2kdgd5 88iPETTppWvFFJF8Ik+oiXY5MX2N8AFNL/y9qytW4aJ6S4pnTflLdjDXOssY1rGGO51z FycJqb3i5KfgMWsXO7nCiuLYSlgAquiw+uQ+EXpJojWDhTMj/eeb5ezX1YY+6NtoOOXg VLGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=LwY5pl2zHPQpHCPl2EeMGMDJCM7CTQzDe7kSoMux6Pc=; b=NWJ5Rfzz0bf86RvktZffETSqnCJj7UQIAnFkC4Ii15xwZj0CArA6OBOjmA/7K6lTdI lMLUcoWXbBCher4dOuKzIiTYiN9Jm8FJkBD03vFV2Q4igN1GtfavoKlZZtHfOHbC985q XOd+bNgRAjLAT9yesHyK1E1SCd3KCeDfFsDtZRZCDhLaD1WgvvhTF4sUMNA4PVpAh2pY J+5/K3b9eOhKUNGveaLzjOtQzeLNWK2bpcHa1idC3GKLnVPG92+s0yJcmw1RpABehgGK UzWJhee9fXkWYsf+wsLaedWEYKEaOkq9uzwxwxK18/VNeB+Q0dEqhuSurvY0GqbN8QRg 3ugQ== X-Gm-Message-State: APjAAAWPSJj4wwr3a5U4O4fVhaDsPHMi4VoljxAGCGCXOECcrFc+5Ryk 3Sq1n05DSi3qrFGg5jSEDnI= X-Received: by 2002:a19:4b4a:: with SMTP id y71mr10955740lfa.118.1567367378539; Sun, 01 Sep 2019 12:49:38 -0700 (PDT) Received: from alpha ([178.71.207.205]) by smtp.gmail.com with ESMTPSA id t1sm704861lji.101.2019.09.01.12.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2019 12:49:38 -0700 (PDT) Received: (nullmailer pid 16050 invoked by uid 1000); Sun, 01 Sep 2019 19:53:01 -0000 Date: Sun, 1 Sep 2019 22:53:01 +0300 From: Ivan Safonov To: Larry Finger Cc: Greg Kroah-Hartman , Michael Straube , Sanjana Sanikommu , Vatsala Narang , Colin Ian King , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: r8188eu: use skb_put_data instead of skb_put/memcpy pair Message-ID: <20190901195301.GA16043@alpha> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org skb_put_data is shorter and clear. Signed-off-by: Ivan Safonov --- Changes in v2: - add "staging: " in message subject; - all code lines now have no breaks in the middle of a sentence. drivers/staging/rtl8188eu/core/rtw_recv.c | 6 +----- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 620da6c003d8..d4278361e002 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1373,11 +1373,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, /* append to first fragment frame's tail (if privacy frame, pull the ICV) */ skb_trim(prframe->pkt, prframe->pkt->len - prframe->attrib.icv_len); - /* memcpy */ - memcpy(skb_tail_pointer(prframe->pkt), pnfhdr->pkt->data, - pnfhdr->pkt->len); - - skb_put(prframe->pkt, pnfhdr->pkt->len); + skb_put_data(prframe->pkt, pnfhdr->pkt->data, pnfhdr->pkt->len); prframe->attrib.icv_len = pnfhdr->attrib.icv_len; plist = plist->next; diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c index eedf2cd831d1..aaab0d577453 100644 --- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c @@ -122,8 +122,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb) precvframe->pkt = pkt_copy; skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */ skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */ - memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len); - skb_put(precvframe->pkt, skb_len); + skb_put_data(pkt_copy, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len); } else { DBG_88E("%s: alloc_skb fail , drop frag frame\n", __func__); -- 2.21.0