Re: [PATCH 06/27] modpost: use bool type where appropriate

From: Nick Desaulniers
Date: Mon Apr 25 2022 - 14:56:36 EST


On Mon, Apr 25, 2022 at 11:34 AM Nick Desaulniers
<ndesaulniers@xxxxxxxxxx> wrote:
>
> /On Sun, Apr 24, 2022 at 12:09 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> > ---
> >
> > scripts/mod/modpost.c | 60 +++++++++++++++++++++----------------------
> > scripts/mod/modpost.h | 10 ++++----
> > 2 files changed, 35 insertions(+), 35 deletions(-)
> >
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index f9cbb6b6b7a5..52dd07a36379 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -203,10 +203,10 @@ struct symbol {
> > struct symbol *next;
> > struct module *module;
> > unsigned int crc;
> > - int crc_valid;
> > + bool crc_valid;
> > char *namespace;
> > - unsigned int weak:1;
> > - unsigned int is_static:1; /* 1 if symbol is not global */
> > + bool weak;
> > + bool is_static; /* true if symbol is not global */
> > enum export export; /* Type of export */
> > char name[];
> > };

This will change the sizeof(struct symbol). I'm guessing we have lots
of symbols to process? If we have many live at once, perhaps it would
be better to keep these as bitfields, but additionally move them to
the end of the struct definition so as to save space?
--
Thanks,
~Nick Desaulniers