diff mbox series

[v3] script: modpost: emit a warning when the description is missing

Message ID 20230615233449.242021-1-vincenzopalazzodev@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v3] script: modpost: emit a warning when the description is missing | expand

Commit Message

Vincenzo Palazzo June 15, 2023, 11:34 p.m. UTC
Emit a warning when the mod description is missed and only
when the W=1 is enabled.

Based on top: https://patchwork.kernel.org/project/linux-kbuild/patch/20230606094159.1910369-1-masahiroy@kernel.org/

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 | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index d4531d09984d..8795af0edba8 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1818,6 +1818,10 @@  static void read_symbols(const char *modname)
 		}
 	}
 
+#ifdef WARN
+	if (extra_warn && !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);