From: Joe Perches <joe@perches.com>
To: John Whitmore <johnfwhitmore@gmail.com>, linux-kernel@vger.kernel.org
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH v2 3/8] staging: rtl8192u: User memset to initialize memory, instead of loop.
Date: Sun, 24 Jun 2018 07:26:41 -0700 [thread overview]
Message-ID: <1ca5d94c5ef94930773c9f3d239e12862a65922d.camel@perches.com> (raw)
In-Reply-To: <20180624095732.12082-4-johnfwhitmore@gmail.com>
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
next prev parent reply other threads:[~2018-06-24 14:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-24 9:57 V2 Coding style changes. Plus one change to use memset() John Whitmore
2018-06-24 9:57 ` [PATCH v2 1/8] staging: rtl8192u: change block comments to prefered style - Coding Style John Whitmore
2018-06-24 9:57 ` [PATCH v2 2/8] staging: rtl8192u: Correct indentation of switch statement " John Whitmore
2018-06-24 9:57 ` [PATCH v2 3/8] staging: rtl8192u: User memset to initialize memory, instead of loop John Whitmore
2018-06-24 14:26 ` Joe Perches [this message]
2018-06-24 14:32 ` John Whitmore
2018-06-24 14:39 ` John Whitmore
2018-06-24 9:57 ` [PATCH v2 4/8] staging: rtl8192u: Truncate block comments to 80 character length - Style John Whitmore
2018-06-24 9:57 ` [PATCH v2 5/8] staging: rtl8192u: Use %s and __func__ instead of hardcoded string " John Whitmore
2018-06-24 9:57 ` [PATCH v2 6/8] staging: rtl8192u: Remove braces from single statement blocks " John Whitmore
2018-06-24 9:57 ` [PATCH v2 7/8] staging: rtl8192u: Correct if statement - Coding Style John Whitmore
2018-06-24 9:57 ` [PATCH v2 8/8] staging: rtl8192u: Correction of spelling mistake in comment John Whitmore
2018-06-24 10:53 ` V2 Coding style changes. Plus one change to use memset() Greg KH
2018-06-24 11:09 ` John Whitmore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ca5d94c5ef94930773c9f3d239e12862a65922d.camel@perches.com \
--to=joe@perches.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johnfwhitmore@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®