Skip to contentSkip to conversation

script: modpost: emit a warning when the description is missing

PATCH Superseded Vincenzo Palazzo 1 participant 1 message Jun 15, 2023 Kbuild

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 script: modpost: emit a warning when the description is missing

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/[email protected]/

---
 scripts/mod/modpost.c | 4 ++++
 1 file changed, 4 insertions(+)
scripts/mod/modpost.c +4 -0
index d4531d09984d..8795af0edba8 100644
@@ -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);
 
Signature · 1 line
2.41.0