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: <CANnaPbDceguo6K2FeZ1OT8Woz9-RYJyn+gptsVTXnaLstTz+zQ@mail.gmail.com>
Date:   Fri, 15 Apr 2022 03:31:00 +0530
From:   MAHAK GUPTA <mahak_g@...iitr.ac.in>
To:     Larry Finger <Larry.Finger@...inger.net>
Cc:     Phillip Potter <phil@...lpotter.co.uk>, gregkh@...uxfoundation.org,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        outreachy@...ts.linux.dev
Subject: Re: [PATCH] staging: r8188eu: remove else after return and break statements

Hi Larry and Pavel,
On Wed, Apr 13, 2022 at 10:21 PM Larry Finger <Larry.Finger@...inger.net> wrote:
>
> On 4/13/22 00:27, Mahak Gupta wrote:
> > Else is not necessary after return and break statements, hence remove
> > it.
> >
> > Reported by checkpatch:
> >
> > WARNING: else is not generally useful after a break or return
> >
> > Signed-off-by: Mahak Gupta <mahak_g@...iitr.ac.in>
>
> The commit message is redundant. I would suggest the following:
>
> checkpatch reports the following:
>
> WARNING: else is not generally useful after a break or return
>
> Remove those cases.
This patch is merged by Greg now but I'll keep this in mind for next
patches. Thanks

>
>
> > ---
> >   drivers/staging/r8188eu/core/rtw_ieee80211.c | 41 ++++++++------------
> >   1 file changed, 17 insertions(+), 24 deletions(-)
> >
> > diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
> > index 5a0e42ed4a47..bb4c9bc864da 100644
> > --- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
> > +++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
> > @@ -97,16 +97,15 @@ bool      rtw_is_cckratesonly_included(u8 *rate)
> >
> >   int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
> >   {
> > -     if (channel > 14) {
> > +     if (channel > 14)
> >               return WIRELESS_INVALID;
> > -     } else {  /*  could be pure B, pure G, or B/G */
> > -             if (rtw_is_cckratesonly_included(rate))
> > -                     return WIRELESS_11B;
> > -             else if (rtw_is_cckrates_included(rate))
> > -                     return  WIRELESS_11BG;
> > -             else
> > -                     return WIRELESS_11G;
> > -     }
> > +     /*  could be pure B, pure G, or B/G */
> > +     if (rtw_is_cckratesonly_included(rate))
> > +             return WIRELESS_11B;
> > +     else if (rtw_is_cckrates_included(rate))
> > +             return  WIRELESS_11BG;
> > +     else
> > +             return WIRELESS_11G;
>
> Is this 'else' necessary?
Yeah, we can remove this else too, sorry didn't notice it. Should I
submit another patch removing this?

>
>
> Larry

Mahak

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ