Re: [PATCH 07/27] modpost: import include/linux/list.h

From: Masahiro Yamada
Date: Sat Apr 30 2022 - 10:23:35 EST


On Wed, Apr 27, 2022 at 1:30 AM Nick Desaulniers
<ndesaulniers@xxxxxxxxxx> wrote:
>
> On Sun, Apr 24, 2022 at 12:09 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> >
> > Import include/linux/list.h to use convenient list macros in modpost.
> >
> > I dropped kernel-space code such as {WRITE,READ}_ONCE etc. and unneeded
> > macros.
> >
> > I also imported container_of() from include/linux/container_of.h and
> > type definitions from include/linux/types.h.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
>
> Ok then, just two small nits about two comments, which may have been
> just copied over from the sources.
> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
>
> > ---
> >
> > scripts/mod/list.h | 336 +++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 336 insertions(+)
> > create mode 100644 scripts/mod/list.h
> >
> > diff --git a/scripts/mod/list.h b/scripts/mod/list.h
> > new file mode 100644
> > index 000000000000..c87583a71714
> > --- /dev/null
> > +++ b/scripts/mod/list.h
> > @@ -0,0 +1,336 @@
>
> <snip>
>
> > +/**
> > + * list_for_each_entry - iterate over list of given type
>
> ^ Excessive whitespace after the `-`
>
> > + * @pos: the type * to use as a loop cursor.
> > + * @head: the head for your list.
> > + * @member: the name of the list_head within the struct.
> > + */
> > +#define list_for_each_entry(pos, head, member) \
> > + for (pos = list_first_entry(head, typeof(*pos), member); \
> > + !list_entry_is_head(pos, head, member); \
> > + pos = list_next_entry(pos, member))
> > +
> > +/**
> > + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
>
> ^ This sounds like two sentences and looks like it's missing
> punctuation separating them?
>
> "iterate over list of given type. Safe against removal of list entry"


OK, I will fold your suggestions.

If you have a chance to fix up include/linux/list.h in the same way,
that would be appreciated.

./scripts/checkpatch.pl -f include/linux/list.h

might be useful to find out style issues.



--
Best Regards
Masahiro Yamada