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: <CAMWRUK6iuyRguC67J2ErzBp6p86OzaqxNDxhKUU=Gpw6crj3TA@mail.gmail.com>
Date:   Sun, 3 Apr 2022 11:33:51 -0400
From:   Sevinj Aghayeva <sevinj.aghayeva@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        outreachy@...ts.linux.dev
Subject: Re: [PATCH 3/3] staging: rtl8723bs: remove redundant else branches

On Sun, Apr 3, 2022 at 7:03 AM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Fri, Apr 01, 2022 at 09:02:47AM -0400, Sevinj Aghayeva wrote:
> > Adhere to Linux kernel coding style.
> >
> > Reported by checkpatch:
> >
> > WARNING: else is not generally useful after a break or return
> >
> > Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@...il.com>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 63 +++++++++----------
> >  1 file changed, 30 insertions(+), 33 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > index 81e4b1bf68f6..b80d9061f5a5 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > @@ -907,10 +907,9 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram
> >                       set_link_timer(pmlmeext, REAUTH_TO);
> >
> >                       return _SUCCESS;
> > -             } else {
> > -                     /*  open system */
> > -                     go2asoc = 1;
> >               }
> > +             /*  open system */
> > +             go2asoc = 1;
> >       } else if (seq == 4) {
> >               if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)
> >                       go2asoc = 1;
> > @@ -1502,32 +1501,32 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
> >
> >
> >               return _SUCCESS;
> > -     } else {
> > -             int     ignore_received_deauth = 0;
> > -
> > -             /*      Commented by Albert 20130604 */
> > -             /*      Before sending the auth frame to start the STA/GC mode connection with AP/GO, */
> > -             /*      we will send the deauth first. */
> > -             /*      However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */
> > -             /*      Added the following code to avoid this case. */
> > -             if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
> > -                     (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
> > -                     if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
> > -                             ignore_received_deauth = 1;
> > -                     } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) {
> > -                             /*  TODO: 802.11r */
> > -                             ignore_received_deauth = 1;
> > -                     }
> > +     }
> > +     int     ignore_received_deauth = 0;
> > +
> > +     /*      Commented by Albert 20130604 */
> > +     /*      Before sending the auth frame to start the STA/GC mode connection with AP/GO, */
> > +     /*      we will send the deauth first. */
> > +     /*      However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */
> > +     /*      Added the following code to avoid this case. */
> > +     if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
> > +             (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
>
> Very odd indentation :(
>

Just to make sure, are you not happy about the existing code or the
comments being indented? Because I've preserved the code structure and
have only removed the else branch. If you could clarify, I would know
what to fix.

Thanks!

-- 

Sevinj.Aghayeva

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ