Skip to content

Commit 1be5fa6

Browse files
committed
modpost: remove is_vmlinux() call in check_for_{gpl_usage,unused}()
check_exports() is never called for vmlinux because mod->skip is set for vmlinux. Hence, check_for_gpl_usage() and check_for_unused() are not called for vmlinux, either. is_vmlinux() is always false here. Remove the is_vmlinux() calls, and hard-code the ".ko" suffix. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 3379576 commit 1be5fa6

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,20 +2144,18 @@ void buf_write(struct buffer *buf, const char *s, int len)
21442144

21452145
static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
21462146
{
2147-
const char *e = is_vmlinux(m) ?"":".ko";
2148-
21492147
switch (exp) {
21502148
case export_gpl:
2151-
fatal("GPL-incompatible module %s%s "
2152-
"uses GPL-only symbol '%s'\n", m, e, s);
2149+
fatal("GPL-incompatible module %s.ko uses GPL-only symbol '%s'\n",
2150+
m, s);
21532151
break;
21542152
case export_unused_gpl:
2155-
fatal("GPL-incompatible module %s%s "
2156-
"uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);
2153+
fatal("GPL-incompatible module %s.ko uses GPL-only symbol marked UNUSED '%s'\n",
2154+
m, s);
21572155
break;
21582156
case export_gpl_future:
2159-
warn("GPL-incompatible module %s%s "
2160-
"uses future GPL-only symbol '%s'\n", m, e, s);
2157+
warn("GPL-incompatible module %s.ko uses future GPL-only symbol '%s'\n",
2158+
m, s);
21612159
break;
21622160
case export_plain:
21632161
case export_unused:
@@ -2169,13 +2167,11 @@ static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
21692167

21702168
static void check_for_unused(enum export exp, const char *m, const char *s)
21712169
{
2172-
const char *e = is_vmlinux(m) ?"":".ko";
2173-
21742170
switch (exp) {
21752171
case export_unused:
21762172
case export_unused_gpl:
2177-
warn("module %s%s "
2178-
"uses symbol '%s' marked UNUSED\n", m, e, s);
2173+
warn("module %s.ko uses symbol '%s' marked UNUSED\n",
2174+
m, s);
21792175
break;
21802176
default:
21812177
/* ignore */

0 commit comments

Comments
 (0)