Re: [PATCH] staging: rtl8723bs: modify struct field to use standard bool type
From: Greg Kroah-Hartman
Date: Thu Apr 03 2025 - 10:13:43 EST
On Thu, Apr 03, 2025 at 05:02:45PM +0300, Dan Carpenter wrote:
> On Thu, Apr 03, 2025 at 02:54:01PM +0100, Greg Kroah-Hartman wrote:
> > > > > 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@xxxxxxxx/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
> >
> > So the structure size changed? That's not good at all, and is what I
> > was worried about :(
> >
>
> You had complained about a different struct. struct rx_pkt_attrib. It's
> fine to modify this one.
Argh, sorry, too many different threads right now, my fault...