script: modpost: emit a warning when the description is missing
authorVincenzo Palazzo <vincenzopalazzodev@gmail.com>
Thu, 15 Jun 2023 23:40:37 +0000 (01:40 +0200)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 24 Jun 2023 09:05:08 +0000 (18:05 +0900)
Emit a warning when the mod description is missed and only
when the W=1 is enabled.

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>
Tested-by: Nicolas Schier <n.schier@avm.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c

index 39cf43d..983f507 100644 (file)
@@ -1720,6 +1720,8 @@ static void read_symbols(const char *modname)
                }
        }
 
+       if (extra_warn && !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);