summaryrefslogtreecommitdiff
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-07-19 19:53:00 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2022-07-27 15:18:00 +0300
commitabe864b8e19adf33b48997de8bc1a8f095390ade (patch)
tree699bb0948240cf9c2d2dea912c8f8638064fb929 /scripts/mod/file2alias.c
parent5764f6626f5f334b27e168a33735b3899d08bcd2 (diff)
downloadlinux-abe864b8e19adf33b48997de8bc1a8f095390ade.tar.xz
modpost: use sym_get_data() to get module device_table data
Use sym_get_data() to replace the long code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index cbd6b0f48b4e..80d973144fde 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1571,9 +1571,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
zeros = calloc(1, sym->st_size);
symval = zeros;
} else {
- symval = (void *)info->hdr
- + info->sechdrs[get_secindex(info, sym)].sh_offset
- + sym->st_value;
+ symval = sym_get_data(info, sym);
}
/* First handle the "special" cases */