Skip to contentSkip to conversation

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

PATCH In review Vincenzo Palazzo 3 participants 3 messages Jun 15, 2023 – Jun 20, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v4 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]/

Sorry the version 3 is wrong, there is no reason
to wrap the if under the W.

---
 scripts/mod/modpost.c | 2 ++
 1 file changed, 2 insertions(+)
scripts/mod/modpost.c +2 -0
index d4531d09984d..0cdf8d655bd3 100644
@@ -1818,6 +1818,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);
 
Signature · 1 line
2.41.0
Tested-by on v4 1/1
#1 lore raw
Quoted 7 lines · Vincenzo Palazzo

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]/

Sorry the version 3 is wrong, there is no reason
to wrap the if under the W.

You probably wanted to put this paragraph below the trailer block (separated by another '---').

Quoted 5 lines

---

Quoted 19 lines
 scripts/mod/modpost.c | 2 ++
 1 file changed, 2 insertions(+)
scripts/mod/modpost.c +2 -0
index d4531d09984d..0cdf8d655bd3 100644
@@ -1818,6 +1818,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);
 
Signature · 1 line
2.41.0
#2 lore raw
Quoted 5 lines · Nicolas Schier
Quoted 3 lines · Vincenzo Palazzo

Emit a warning when the mod description is missed and only when the W=1 is enabled.

Quoted 7 lines
Quoted 4 lines

Based on top: https://patchwork.kernel.org/project/linux-kbuild/patch/[email protected]/

Sorry the version 3 is wrong, there is no reason
to wrap the if under the W.

You probably wanted to put this paragraph below the trailer block (separated by another '---').

I removed this paragraph and applied to linux-kbuild.

Thanks.

Quoted 28 lines
Quoted 5 lines

---

Quoted 19 lines
 scripts/mod/modpost.c | 2 ++
 1 file changed, 2 insertions(+)
scripts/mod/modpost.c +2 -1
index d4531d09984d..0cdf8d655bd3 100644
@@ -1818,6 +1818,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);
 
--

2.41.0

Signature · 2 lines
Best Regards
Masahiro Yamada