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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADYq+faUTmNcUgk5jB3YHT4UCQZhf=Wsah1WUcPHqky6kp_cUA@mail.gmail.com>
Date: Thu, 3 Apr 2025 10:33:49 +0100
From: Samuel Abraham <abrahamadekunle50@...il.com>
To: Julia Lawall <julia.lawall@...ia.fr>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, outreachy@...ts.linux.dev, 
	linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: modify struct field to use standard
 bool type

On Thu, Apr 3, 2025 at 6:06 AM Julia Lawall <julia.lawall@...ia.fr> wrote:
>
>
>
> On Wed, 2 Apr 2025, Abraham Samuel Adekunle wrote:
>
> > The struct field uses the uint values 0 and 1 to represent false and
> > true values respectively.
> >
> > Convert cases to use the bool type instead to conform to Linux
> > coding styles and ensure consistency.
>
> This is vague.  Ensure consistency with what?  You can point out that true
> or false was already being used elsewhere in the code.
>
> >
> > reported by Coccinelle:
> >
> > Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_ap.c      | 2 +-
> >  drivers/staging/rtl8723bs/include/sta_info.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > index ed6942e289a5..82f54f769ed1 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > @@ -389,7 +389,7 @@ void update_bmc_sta(struct adapter *padapter)
> >               psta->qos_option = 0;
> >               psta->htpriv.ht_option = false;
> >
> > -             psta->ieee8021x_blocked = 0;
> > +             psta->ieee8021x_blocked = false;
> >
> >               memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
> >
> > diff --git a/drivers/staging/rtl8723bs/include/sta_info.h b/drivers/staging/rtl8723bs/include/sta_info.h
> > index b3535fed3de7..63343998266a 100644
> > --- a/drivers/staging/rtl8723bs/include/sta_info.h
> > +++ b/drivers/staging/rtl8723bs/include/sta_info.h
> > @@ -86,7 +86,7 @@ struct sta_info {
> >       uint qos_option;
> >       u8 hwaddr[ETH_ALEN];
> >
> > -     uint    ieee8021x_blocked;      /* 0: allowed, 1:blocked */
> > +     bool ieee8021x_blocked;

> You should also check whether this is a structure that is read from the
> hardware.  In that case, it would be a concern if the bool field does not
> have the same size as the uint one.
Hello Julia
So following the conversation here,
https://lore.kernel.org/outreachy/bf8994cc-b812-f628-ff43-5dae8426e266@inria.fr/T/#u
I was able to compare the assembly code of the file before and after
my patch and this were my findings

Original assembly code for
# drivers/staging/rtl8723bs/core/rtw_ap.c:392    psta->ieee8021x_blocked = 0;
movl  $0, 436(%r12)    #,  psta->ieee8021x_blocked

Assembly Code After Patch
# drivers/staging/rtl8723bs/core/rtw_ap.c:392
psta->ieee8021x_blocked = false;
movb  $0, 434(%r12)    #,  psta->ieee8021x_blocked

Adekunle

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ