On Thu, Jun 8, 2023 at 5:06 AM Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx> wrote: > > > On Thu, Mar 9, 2023 at 9:01 PM Vincenzo Palazzo > > <vincenzopalazzodev@xxxxxxxxx> wrote: > > > > > > Emit a warning when the mod description is missed and only > > > when the W=1 is enabled. > > > > > > Reported-by: Roland Kletzing <devzero@xxxxxx> > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=10770 > > > Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx> > > > --- > > > scripts/mod/modpost.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > > > index efff8078e395..433518dfc472 100644 > > > --- a/scripts/mod/modpost.c > > > +++ b/scripts/mod/modpost.c > > > @@ -1824,6 +1824,10 @@ static void read_symbols(const char *modname) > > > } > > > } > > > > > > +#ifdef WARN > > > + if (!get_modinfo(&info, "description")) > > > + warn("missing MODULE_DESCRIPTION() in %s\n", modname); > > > +#endif > > > for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { > > > symname = remove_dot(info.strtab + sym->st_name); > > > > > > Sorry for the delay. > > > > Users need to do "make HOSTCFLAGS=-DWARN" to make it work, > > but nobody would do it. > > > > > > I did a ground work: > > https://patchwork.kernel.org/project/linux-kbuild/patch/20230606094159.1910369-1-masahiroy@xxxxxxxxxx/ > > > > Uh, thanks for doing this! > > > > > > > Then, you can do like this: > > > > if (extra_warn && !get_modinfo(&info, "description")) > > warn("missing MODULE_DESCRIPTION() in %s\n", modname); > > > > Do you preferer that I rebase on top of your patch? or just waiting that > your patch will be in next? Whichever. Your patch changes a different hunk, so no merge conflict would happen anyway. -- Best Regards Masahiro Yamada