summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-06-01 07:57:30 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2020-06-06 16:39:20 +0200
commit4de7b62936122570408357417f21072e78292926 (patch)
treee1b1bd510421bceb2b4eb86d4947db403bd7f25e /scripts
parentmodpost: strip .o from modname before calling new_module() (diff)
downloadlinux-4de7b62936122570408357417f21072e78292926.tar.xz
linux-4de7b62936122570408357417f21072e78292926.zip
modpost: remove is_vmlinux() helper
Now that is_vmlinux() is called only in new_module(), we can inline the function call. modname is the basename with '.o' is stripped. No need to compare it with 'vmlinux.o'. vmlinux is always located at the current working directory. No need to strip the directory path. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index ebfa9b76ba92..a3ffabf4eca5 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -88,20 +88,6 @@ static inline bool strends(const char *str, const char *postfix)
return strcmp(str + strlen(str) - strlen(postfix), postfix) == 0;
}
-static int is_vmlinux(const char *modname)
-{
- const char *myname;
-
- myname = strrchr(modname, '/');
- if (myname)
- myname++;
- else
- myname = modname;
-
- return (strcmp(myname, "vmlinux") == 0) ||
- (strcmp(myname, "vmlinux.o") == 0);
-}
-
void *do_nofail(void *ptr, const char *expr)
{
if (!ptr)
@@ -181,7 +167,7 @@ static struct module *new_module(const char *modname)
/* add to list */
strcpy(mod->name, modname);
- mod->is_vmlinux = is_vmlinux(modname);
+ mod->is_vmlinux = (strcmp(modname, "vmlinux") == 0);
mod->gpl_compatible = -1;
mod->next = modules;
modules = mod;