From: Phillip Potter <phil@philpotter.co.uk>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
Martin Kaiser <martin@kaiser.cx>,
Michael Straube <straube.linux@gmail.com>,
Fabio Aiuto <fabioaiuto83@gmail.com>,
linux-staging@lists.linux.dev,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: r8188eu: Remove variables and simplify PHY_SwChnl8188E()
Date: Sat, 14 Aug 2021 18:15:38 +0100 [thread overview]
Message-ID: <CAA=Fs0m8nh318ox0s2sg+fMtaqqdn7anev5a9pLbM0yUvkXajA@mail.gmail.com> (raw)
In-Reply-To: <20210813160812.17603-1-fmdefrancesco@gmail.com>
On Fri, 13 Aug 2021 at 17:08, Fabio M. De Francesco
<fmdefrancesco@gmail.com> wrote:
>
> Remove "bResult" and "tmpchannel" and all tests and assignments that
> are related to them in the code of PHY_SwChnl8188E().
>
> "bResult" was always true, therefore its test led to a null statement.
> "tmpchannel" was used only to restore "pHalData->CurrentChannel" to its
> previous value only if _PHY_SwChnl8192C() was not called; therefore
> assign "channel" to "pHalData->CurrentChannel" if and only if
> _PHY_SwChnl8192C() is to be executed (and get rid of that temporary
> storage).
>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
> index 02955b8c4005..9af91ec92d36 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
> @@ -1091,8 +1091,6 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)
> {
> /* Call after initialization */
> struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
> - u8 tmpchannel = pHalData->CurrentChannel;
> - bool bResult = true;
>
> if (pHalData->rf_chip == RF_PSEUDO_11N)
> return; /* return immediately if it is peudo-phy */
> @@ -1100,17 +1098,8 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)
> if (channel == 0)
> channel = 1;
>
> - pHalData->CurrentChannel = channel;
> -
> if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved)) {
> + pHalData->CurrentChannel = channel;
> _PHY_SwChnl8192C(Adapter, channel);
> -
> - if (bResult)
> - ;
> - else
> - pHalData->CurrentChannel = tmpchannel;
> -
> - } else {
> - pHalData->CurrentChannel = tmpchannel;
> }
> }
> --
> 2.32.0
>
Dear Fabio,
Good stuff, thanks.
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Regards,
Phil
prev parent reply other threads:[~2021-08-14 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 16:08 [PATCH] staging: r8188eu: Remove variables and simplify PHY_SwChnl8188E() Fabio M. De Francesco
2021-08-14 17:15 ` Phillip Potter [this message]
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='CAA=Fs0m8nh318ox0s2sg+fMtaqqdn7anev5a9pLbM0yUvkXajA@mail.gmail.com' \
--to=phil@philpotter.co.uk \
--cc=Larry.Finger@lwfinger.net \
--cc=fabioaiuto83@gmail.com \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=martin@kaiser.cx \
--cc=straube.linux@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;
as well as URLs for NNTP newsgroup(s).