Skip to contentSkip to conversation

script: modpost: emit warning when description is missing

PATCH Superseded Vincenzo Palazzo 2 participants 3 messages Mar 6, 2023 – Mar 8, 2023 Kbuild

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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

Emit a warning when the mod description is missed.

---
 scripts/mod/modpost.c | 3 +++
 1 file changed, 3 insertions(+)
scripts/mod/modpost.c +3 -0
index efff8078e395..c63156ba4e5e 100644
@@ -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);
 
Signature · 1 line
2.39.2
#1 lore raw
Quoted 25 lines · Vincenzo Palazzo

Emit a warning when the mod description is missed.

---
 scripts/mod/modpost.c | 3 +++
 1 file changed, 3 insertions(+)
scripts/mod/modpost.c +3 -1
index efff8078e395..c63156ba4e5e 100644
@@ -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);
 
--
Quoted 2 lines

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.

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 26 lines · Masahiro Yamada
Quoted 24 lines · Vincenzo Palazzo

Emit a warning when the mod description is missed.

---
 scripts/mod/modpost.c | 3 +++
 1 file changed, 3 insertions(+)
scripts/mod/modpost.c +3 -0
index efff8078e395..c63156ba4e5e 100644
@@ -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);
 
Quoted 8 lines
Quoted 3 lines

--
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!

Quoted 2 lines

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.