aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-06-01 14:57:25 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-06-06 23:38:13 +0900
commit1be5fa6c948533bb95ac783010ef686261be5384 (patch)
treea749cb26672b6a7914684d4a28ba961830dba857
parentmodpost: remove mod->is_dot_o struct member (diff)
downloadwireguard-linux-1be5fa6c948533bb95ac783010ef686261be5384.tar.xz
wireguard-linux-1be5fa6c948533bb95ac783010ef686261be5384.zip
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>
-rw-r--r--scripts/mod/modpost.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index bc00bbac50bb..84a642c14775 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2144,20 +2144,18 @@ void buf_write(struct buffer *buf, const char *s, int len)
static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
{
- const char *e = is_vmlinux(m) ?"":".ko";
-
switch (exp) {
case export_gpl:
- fatal("GPL-incompatible module %s%s "
- "uses GPL-only symbol '%s'\n", m, e, s);
+ fatal("GPL-incompatible module %s.ko uses GPL-only symbol '%s'\n",
+ m, s);
break;
case export_unused_gpl:
- fatal("GPL-incompatible module %s%s "
- "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);
+ fatal("GPL-incompatible module %s.ko uses GPL-only symbol marked UNUSED '%s'\n",
+ m, s);
break;
case export_gpl_future:
- warn("GPL-incompatible module %s%s "
- "uses future GPL-only symbol '%s'\n", m, e, s);
+ warn("GPL-incompatible module %s.ko uses future GPL-only symbol '%s'\n",
+ m, s);
break;
case export_plain:
case export_unused:
@@ -2169,13 +2167,11 @@ static void check_for_gpl_usage(enum export exp, const char *m, const char *s)
static void check_for_unused(enum export exp, const char *m, const char *s)
{
- const char *e = is_vmlinux(m) ?"":".ko";
-
switch (exp) {
case export_unused:
case export_unused_gpl:
- warn("module %s%s "
- "uses symbol '%s' marked UNUSED\n", m, e, s);
+ warn("module %s.ko uses symbol '%s' marked UNUSED\n",
+ m, s);
break;
default:
/* ignore */