Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2926163imm; Sun, 24 Jun 2018 07:34:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJFFEICz8A3EnDCK+vO0672Ejs1XiP0jg4mcn3tbcr9phsZIW9W3p13lcj9+HdavPgyVmmc X-Received: by 2002:a63:2404:: with SMTP id k4-v6mr7626493pgk.191.1529850846321; Sun, 24 Jun 2018 07:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529850846; cv=none; d=google.com; s=arc-20160816; b=nBbf5mpSfDDwiwoqX7+Kk1DpdJH4C/eNQYyIh5pMU1H13bTQ8xunnGRqfF+C9j7MzL 4Teq3yU1UM7BZTrDOmE63YEQVb/CHHWFKtHiKgs+09Fp/3YMXH58m97TiQOn6WLQ25UH juHH8yZD3+xhBlBtY9EgCUkcVv2TbmTgmJqg1Xlf3YrwUtQfw4ZrBEgmNJAiIfNnRupz DRXAhIbzX13K1EA/vREca1w1ZEvgxrBbkWqprib3HqOxnj12nYc4TdX9TRKyDh7NaLB4 LQzS9/F7FEjknOSwCMBWmVCAnUKIvE/xuzntOqLgio7no6XoZx1C9ydPZ+SXvKdw1Ou6 14ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=op1KnoKyvaMU06nGFmlNHyAcLN3KvvNe2cB7ahRoM14=; b=SAop+62V2MR9ZmIc25PONUW3s67tg6noB54VPLUnHWVYODo+8bm9wx3EjqzDy0YJLP GlBVQJTy922+w27oS/F/NNRUBSBpWGH/mWbSPAFqN7m5mgnU9srwSwcHGVDl1oOTinPD ZWoylhtkwsNX8XRL6kK3/nqPLQ2x/+lCrHb/kuwP7+I34hxszE3wfkAkhZin3afWq31M YPE1NnVrnjk0cLdtNtiU+N21rmyStr4vaY/wCQtJrue9BYuCXeVK/Uuu+++2qwTKMDf3 pHLgm+dVX99x9gZwNw/EcCUV/CA3xqznnl+AuDvKu8biCjsbsHPHnWW4hul7wNTvcyyW Hzsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="KgNR/G1K"; 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 u16-v6si9649576pgv.409.2018.06.24.07.33.51; Sun, 24 Jun 2018 07:34: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="KgNR/G1K"; 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 S1752027AbeFXOdL (ORCPT + 99 others); Sun, 24 Jun 2018 10:33:11 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35043 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbeFXOdK (ORCPT ); Sun, 24 Jun 2018 10:33:10 -0400 Received: by mail-wr0-f196.google.com with SMTP id c13-v6so1086916wrq.2 for ; Sun, 24 Jun 2018 07:33:09 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=op1KnoKyvaMU06nGFmlNHyAcLN3KvvNe2cB7ahRoM14=; b=KgNR/G1KAKaYnEFieQyeSPzc44CtHuLshhw+ojseXAsMz5F6nD9ySD1Gvw+1qdkgqd MzRvvuwVa/Fu8sa5WYaAMdKQ0IypKphWMVR8Vc5ydZfwk9Z2Rs991Q+5vvcwLrzTA7XO jJqlKQXi6J+UZqUib5v3CrPpU7T2B8ls39gAG6iLuKrPKWpCQzJydsGws7yhpZLDBHXJ eXhzpqvtRP/ibQKpcPEZzx7WIVeEGIMQt1AaSg6dj0QNArct8vVaUD35PZSES4IASObe 6j4axlRkgaLUcQsWrcUlxNtG8AQY+pTu5d5pOzVOX3/RwufPOAAGOmZSk4/wtzrdwGtl Hjwg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=op1KnoKyvaMU06nGFmlNHyAcLN3KvvNe2cB7ahRoM14=; b=MKW/JBxXggA4x0javFPhF/+jTb0ol22NjdxR2HiyMZT4ma+76yaNIm9PWgUjldnder sq/x0eu2uJCTH7Op45eQa4wwsNpFrc4KopLKcnvnNBEH3Rl1LBXyMsMveDOgtS50ju64 dQc8cJQP90Hh8Dx8UUB7yOvEvmCQ7CHLa6+IGLNlRl2Vf2fo5niv4hbZX3lz8xpjGGZ+ d2FTiHJEmY1eKmfq7lTsCZpdXew+L294iobNhMM2J+WA7TUv+y9Lrp2wcHjiJz2IhsGn X0Y/+ha2B01+AzC3L+wTLM7nXhNLl+fl2ZwbAbfyaAXXc16mc3miGxAGX6cKFh8Gy6N0 jK0w== X-Gm-Message-State: APt69E1M1Vr0Bh+Wavm2AB9JwCVuPZ0wH+2pmYklsoHmcN3aeMSINULO K+MW/qrOVHFteSSBi+tV+dk= X-Received: by 2002:adf:b2a7:: with SMTP id g36-v6mr1677466wrd.218.1529850789172; Sun, 24 Jun 2018 07:33:09 -0700 (PDT) Received: from xux707-tw (host86-190-130-185.range86-190.btcentralplus.com. [86.190.130.185]) by smtp.gmail.com with ESMTPSA id 189-v6sm2499306wmd.17.2018.06.24.07.32.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 07:33:08 -0700 (PDT) Date: Sun, 24 Jun 2018 15:32:49 +0100 From: John Whitmore To: Joe Perches Cc: John Whitmore , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, gregkh@linuxfoundation.org Subject: Re: [PATCH v2 3/8] staging: rtl8192u: User memset to initialize memory, instead of loop. Message-ID: <20180624143243.uxxgdfe4pldgwlb3@xux707-tw> References: <20180624095732.12082-1-johnfwhitmore@gmail.com> <20180624095732.12082-4-johnfwhitmore@gmail.com> <1ca5d94c5ef94930773c9f3d239e12862a65922d.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ca5d94c5ef94930773c9f3d239e12862a65922d.camel@perches.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 24, 2018 at 07:26:41AM -0700, Joe Perches wrote: > On Sun, 2018-06-24 at 10:57 +0100, John Whitmore wrote: > > Replaced memory initialising loop with memset, as suggested by Andy Shevchenko > [] > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c > [] > > @@ -742,8 +742,6 @@ void HTConstructRT2RTAggElement(struct ieee80211_device *ieee, u8 *posRT2RTAgg, > > */ > > static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 *pOperateMCS) > > { > > - u8 i; > > - > > if (!pOperateMCS) { > > IEEE80211_DEBUG(IEEE80211_DL_ERR, "pOperateMCS can't be null in HT_PickMCSRate()\n"); > > return false; > > @@ -756,8 +754,7 @@ static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 *pOperateMCS) > > //legacy rate routine handled at selectedrate > > > > //no MCS rate > > - for (i = 0; i <= 15; i++) > > - pOperateMCS[i] = 0; > > + memset(pOperateMCS, 0, 15); > > Not the same code. > > Loop is <= 15, so memset should use 16 > Arragghhhh! Thank you and thank you for spotting that. I'll reissue again. I should have been more careful. Sorry.