From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Cc: Ira Weiny <ira.weiny@intel.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: rtl8723bs: simplify control flow
Date: Sat, 2 Apr 2022 11:13:09 +0200 [thread overview]
Message-ID: <YkgTpS+pzhWPgVIh@kroah.com> (raw)
In-Reply-To: <20220401224619.GA71483@euclid>
On Fri, Apr 01, 2022 at 06:46:19PM -0400, Sevinj Aghayeva wrote:
> On Fri, Apr 01, 2022 at 02:34:04PM -0700, Ira Weiny wrote:
> > On Fri, Apr 01, 2022 at 07:46:35AM -0400, Sevinj Aghayeva wrote:
> > > The function iterates an index from 0 to NUM_PMKID_CACHE and returns
> > > the first index for which the condition is true. If no such index is
> > > found, the function returns -1. Current code has a complex control
> > > flow that obfuscates this simple task. Replace it with a loop.
> > >
> > > Also, given the shortened function body, replace the long variable
> > > name psecuritypriv with a short variable name p.
> > >
> > > Reported by checkpatch:
> > >
> > > WARNING: else is not generally useful after a break or return
> > >
> > > Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
> >
> > Wow! Nice find! This is a huge clean up. Extra kudos recognizing that it is
> > not just the else statement which is broken here!
>
> Thanks! It took me a while to realize what this loop is doing.
>
> > The only issue for the patch is that I don't see any maintainer emailed?
> > However, I don't see a maintainer listed in the MAINTAINERS file so ...
> >
> > Reviewed-by: Ira Weiny <ira.weiny@intel.com>
>
> Thanks for the review!
>
> Greg, please do not apply this yet. After I sent out the patch, I
> noticed the comment at the top of the function:
>
> /* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) */
>
> So I did a git grep to find the original function and fix it as well,
> and it looks like there are three copies of the same function in
> different files:
>
> $ git grep IsInPreAuthKeyList
> r8188eu/core/rtw_mlme.c:/* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) */
> rtl8712/rtl871x_mlme.c: * Ported from 8185: IsInPreAuthKeyList().
> rtl8723bs/core/rtw_mlme.c:/* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) */
>
> I will later send a v2 patch that replaces all of them.
No, please do one patch per driver. These are all different drivers
(cut/pasted from some original source), so this patch is fine as-is.
You can make 2 other patches as well for the other drivers.
thanks,
greg k-h
next prev parent reply other threads:[~2022-04-02 9:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 11:46 Sevinj Aghayeva
2022-04-01 21:34 ` Ira Weiny
2022-04-01 22:46 ` Sevinj Aghayeva
2022-04-02 9:13 ` Greg Kroah-Hartman [this message]
2022-04-03 13:50 ` Sevinj Aghayeva
2022-04-03 22:42 Sevinj Aghayeva
2022-04-12 23:48 ` Ira Weiny
[not found] ` <CAMWRUK6FaOC1+3ZP+af7uSyfAHjZ3KWwNqM1GjRYth+OyA-8EQ@mail.gmail.com>
2022-04-13 3:01 ` Sevinj Aghayeva
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=YkgTpS+pzhWPgVIh@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
--cc=sevinj.aghayeva@gmail.com \
/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®