lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAA=Fs0m8nh318ox0s2sg+fMtaqqdn7anev5a9pLbM0yUvkXajA@mail.gmail.com>
Date:   Sat, 14 Aug 2021 18:15:38 +0100
From:   Phillip Potter <phil@...lpotter.co.uk>
To:     "Fabio M. De Francesco" <fmdefrancesco@...il.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Larry Finger <Larry.Finger@...inger.net>,
        Martin Kaiser <martin@...ser.cx>,
        Michael Straube <straube.linux@...il.com>,
        Fabio Aiuto <fabioaiuto83@...il.com>,
        linux-staging@...ts.linux.dev,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: r8188eu: Remove variables and simplify PHY_SwChnl8188E()

On Fri, 13 Aug 2021 at 17:08, Fabio M. De Francesco
<fmdefrancesco@...il.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@...il.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@...lpotter.co.uk>

Regards,
Phil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ