Message ID | 20230306174159.145224-1-vincenzopalazzodev@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | emit a warning when mod description is missing | expand |
On Tue, Mar 7, 2023 at 2:42 AM Vincenzo Palazzo <vincenzopalazzodev@gmail.com> wrote: > > Emit a warning when the mod description is missed. > > Reported-by: Roland Kletzing <devzero@web.de> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=10770 > Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> > --- > scripts/mod/modpost.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index efff8078e395..c63156ba4e5e 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -1824,6 +1824,9 @@ static void read_symbols(const char *modname) > } > } > > + if (!get_modinfo(&info, "description")) > + warn("missing MODULE_DESCRIPTION() in %s\n", modname); > + > for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { > symname = remove_dot(info.strtab + sym->st_name); > > -- > 2.39.2 > Linus requires a clean build log these days. This patch would sprinkle warning messages, and I am sure it will result in a rejection. The best we can do would print the warnings only when W=1.
On Tue Mar 7, 2023 at 3:34 AM CET, Masahiro Yamada wrote: > On Tue, Mar 7, 2023 at 2:42 AM Vincenzo Palazzo > <vincenzopalazzodev@gmail.com> wrote: > > > > Emit a warning when the mod description is missed. > > > > Reported-by: Roland Kletzing <devzero@web.de> > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=10770 > > Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> > > --- > > scripts/mod/modpost.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > > index efff8078e395..c63156ba4e5e 100644 > > --- a/scripts/mod/modpost.c > > +++ b/scripts/mod/modpost.c > > @@ -1824,6 +1824,9 @@ static void read_symbols(const char *modname) > > } > > } > > > > + if (!get_modinfo(&info, "description")) > > + warn("missing MODULE_DESCRIPTION() in %s\n", modname); > > + > > for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { > > symname = remove_dot(info.strtab + sym->st_name); > > > > -- > > 2.39.2 > > > > > Linus requires a clean build log these days. > This patch would sprinkle warning messages, > and I am sure it will result in a rejection. I see, thanks to let me know! > The best we can do would print the warnings > only when W=1. I will do it in a v2 later today, thanks! Cheers! Vincent.
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index efff8078e395..c63156ba4e5e 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1824,6 +1824,9 @@ static void read_symbols(const char *modname) } } + if (!get_modinfo(&info, "description")) + warn("missing MODULE_DESCRIPTION() in %s\n", modname); + for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { symname = remove_dot(info.strtab + sym->st_name);
Emit a warning when the mod description is missed. Reported-by: Roland Kletzing <devzero@web.de> Link: https://bugzilla.kernel.org/show_bug.cgi?id=10770 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> --- scripts/mod/modpost.c | 3 +++ 1 file changed, 3 insertions(+)