summaryrefslogtreecommitdiffstats
path: root/scripts/mod/sumversion.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2021-08-28 11:50:59 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2021-09-03 01:17:21 +0200
commite54dd93a08228b9942d708b133ad3715d92712b0 (patch)
treedfba8e69b96e387e335b366564ff4584b2322785 /scripts/mod/sumversion.c
parentcheckkconfigsymbols.py: Fix the '--ignore' option (diff)
downloadlinux-e54dd93a08228b9942d708b133ad3715d92712b0.tar.xz
linux-e54dd93a08228b9942d708b133ad3715d92712b0.zip
modpost: get the *.mod file path more simply
get_src_version() strips 'o' or 'lto.o' from the end of the object file path (so, postfixlen is 1 or 5), then adds 'mod'. If you look at the code closely, mod->name already holds the base path with the extension stripped. Most of the code changes made by commit 7ac204b545f2 ("modpost: lto: strip .lto from module names") was actually unneeded. sumversion.c does not need strends(), so it can get back local in modpost.c again. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/mod/sumversion.c')
-rw-r--r--scripts/mod/sumversion.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index 760e6baa7eda..905c0ec291e1 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -391,14 +391,9 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen)
struct md4_ctx md;
char *fname;
char filelist[PATH_MAX + 1];
- int postfix_len = 1;
-
- if (strends(modname, ".lto.o"))
- postfix_len = 5;
/* objects for a module are listed in the first line of *.mod file. */
- snprintf(filelist, sizeof(filelist), "%.*smod",
- (int)strlen(modname) - postfix_len, modname);
+ snprintf(filelist, sizeof(filelist), "%s.mod", modname);
buf = read_text_file(filelist);