Received: by 10.223.176.5 with SMTP id f5csp1763402wra; Sun, 4 Feb 2018 11:29:52 -0800 (PST) X-Google-Smtp-Source: AH8x227ENH/qS+F7H5tkW03FBtxh5qsVTGdk86642qwKrRC7LnSY5mJBlaMl0hjelAKVqB9Jwibs X-Received: by 10.98.73.157 with SMTP id r29mr4331822pfi.218.1517772592730; Sun, 04 Feb 2018 11:29:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517772592; cv=none; d=google.com; s=arc-20160816; b=o2ZVRahgCplMdpip0oYAwyL3MewfZFaamEQVH0FvnUb74cIEW3Mid8pduThGN6waVB KLCeROM5Lp4HL3vWDCu5fEf8zjH6LDWoMb3U0xMoPBQIvC5swNWulE8b8dKTHZVAh89x j+1x87e/ZKB/jOFNNSpXqqbaVvhgkX6wHXPeVvNjnWSir4vzUlt+2iRo03DItGLMbAh6 hxOGAq8HzGlX/0u8qkFmaE6EAVMCXLjYfq+MV8Ebt/6XfsLv68KAxG3TMA8EyzW5XVFe Ecxrj0TdMGWhnPAQhNOd90mr9kioB9t0zhoScj+oC0pAM7KCWkb0AgWB9ycDAfD96fQu /sqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=R/5kYPBkxBZJWAQSv57gI8d8KoqBoTbx8Ap+b4A+yvg=; b=dgZQKqknc/KPrC3NRKHiFYSgI2q1HNeWp6COOfB3d6INHYQPy9L7P8MvHjoOCF83pW B+3XBysZjNK111sYuzSElFE/PgjvJV6I8uqI+9tBD82++kwsGDktEEXL1Ea2w9G4Pmfx uhSdKRoTCDVzhyXuiVlr6VT2SDYTZjUDl48IThy5pkp2GBh651aK/Az/tJXQ9olZJsP6 u+DCg03lJfQQJxZ7k4UyH56hJ0/UTXQgRRWLGYExJJKpcl4ZK4YqGpAhDGxwSC9a/12I sp/ywQHVPnpVM96yEwldat+iRoRz82sGyZUXwwb3Z/f0bgfnPvuU/5RWPUQNQPnP4oZc du7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IndGyXeJ; 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=NONE 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 h10si3044542pgs.458.2018.02.04.11.29.38; Sun, 04 Feb 2018 11:29:52 -0800 (PST) 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=IndGyXeJ; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511AbeBDT2G (ORCPT + 99 others); Sun, 4 Feb 2018 14:28:06 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38838 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752193AbeBDT13 (ORCPT ); Sun, 4 Feb 2018 14:27:29 -0500 Received: by mail-lf0-f66.google.com with SMTP id g72so38765090lfg.5 for ; Sun, 04 Feb 2018 11:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R/5kYPBkxBZJWAQSv57gI8d8KoqBoTbx8Ap+b4A+yvg=; b=IndGyXeJ0vyub7NoNJVEqRhMyJIVVer6MsFEDyVDAmKqINV1ZkhtlmdR4MT6zP1qK/ v3i+QI7IhlEguJmLhia3Bx53dLbzxFjwgve1yjIP3A6jP0T8djsvo0SQYd1rDLHEJsHa FB9RY8N3frD8pWQMzT8SUqRGZR7mdsSZN0maY9Qjx16YWXXTcWzNsMN4DBCwN+z4JBV+ l4TcsWGxRCXFwYtMmP7GOuhmfscfew7zTM4expwwjt498QjnrkWWpSAYg5J/u63C8op0 weniltqnzpZvP7IjKD323TqnMhWeyQKFmY5qOwAgJ8vUwTCJ2zCzC1zqvch1MPSiddCF GmfA== 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:in-reply-to :references; bh=R/5kYPBkxBZJWAQSv57gI8d8KoqBoTbx8Ap+b4A+yvg=; b=K2hC+UuY8QPLL2PmjL/AWlM/Ik3kRlAt5ASv4CQBnIPhLydITBidZFDxna4YbrXwe7 FZ4X94RpkgYkcSynxHxS8jhWg9MeF/p0vu/WYpFJEQVjs2V0Ee7Sd0hdShME496HpyfU Ih0CIONeZIK6aU2OUhA9frJo5z3ti8BQ+quqzTlT+TqwQ1bhe5h/p+s1DnL5PxlISxTM vjDD8lHyUuYvuKs/zB476zgk6H22IQY6XnKASWPqtrPmqP1pVTqyo+z8TfQ6b+rj7/xj E3rMcUk8+D/YunGrzM9gRNkoqT7T0dqeByvZyjGRbGNu9C6gcItfoJPFcGva9y7nwtSB h9UQ== X-Gm-Message-State: AKwxytezarGnDz6mVZd6zVkrFeCafm0JsDjhsOiMrm3cLrxQUoDlxzyq qw2N5hDBGDY8PQO0PkxY1ZM= X-Received: by 10.46.50.5 with SMTP id y5mr13500057ljy.111.1517772447565; Sun, 04 Feb 2018 11:27:27 -0800 (PST) Received: from alpha (pppoe.178-66-99-36.dynamic.avangarddsl.ru. [178.66.99.36]) by smtp.gmail.com with ESMTPSA id z20sm1491557ljb.71.2018.02.04.11.27.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Feb 2018 11:27:27 -0800 (PST) Received: (nullmailer pid 13252 invoked by uid 1000); Sun, 04 Feb 2018 19:28:05 -0000 From: Ivan Safonov To: Greg Kroah-Hartman Cc: Janani Sankara Babu , Ivan Safonov , Julia Lawall , Gargi Sharma , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] staging:r8188eu: Remove struct pkt_file from rtw_xmitframe_coalesce() Date: Sun, 4 Feb 2018 22:27:38 +0300 Message-Id: <20180204192739.13202-3-insafonov@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180204192739.13202-1-insafonov@gmail.com> References: <20180204192739.13202-1-insafonov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Struct pkt_file is a base to simple wrapper for skb_copy_bits(). Eliminate struct pkt_file usage in rtw_xmitframe_coalesce(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index eb46e34ba562..6b32c142fdcc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -943,7 +943,6 @@ This sub-routine will perform all the following: */ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe) { - struct pkt_file pktfile; s32 frg_inx, frg_len, mpdu_len, llc_sz, mem_sz; size_t addr; u8 *pframe, *mem_start; @@ -954,7 +953,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct u8 *pbuf_start; s32 bmcst = IS_MCAST(pattrib->ra); s32 res = _SUCCESS; - + size_t remainder = pkt->len - ETH_HLEN; psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra); @@ -979,9 +978,6 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct goto exit; } - _rtw_open_pktfile(pkt, &pktfile); - _rtw_pktfile_read(&pktfile, NULL, ETH_HLEN); - frg_inx = 0; frg_len = pxmitpriv->frag_len - 4;/* 2346-4 = 2342 */ @@ -1038,12 +1034,9 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct if ((pattrib->icv_len > 0) && (pattrib->bswenc)) mpdu_len -= pattrib->icv_len; - if (bmcst) { - /* don't do fragment to broadcat/multicast packets */ - mem_sz = _rtw_pktfile_read(&pktfile, pframe, pattrib->pktlen); - } else { - mem_sz = _rtw_pktfile_read(&pktfile, pframe, mpdu_len); - } + mem_sz = min_t(size_t, bmcst ? pattrib->pktlen : mpdu_len, remainder); + skb_copy_bits(pkt, pkt->len - remainder, pframe, mem_sz); + remainder -= mem_sz; pframe += mem_sz; @@ -1054,7 +1047,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct frg_inx++; - if (bmcst || pktfile.pkt_len == 0) { + if (bmcst || remainder == 0) { pattrib->nr_frags = frg_inx; pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) + -- 2.13.6