Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

modpost: move export_from_secname() call to more relevant place

The assigned 'export' is only used when

if (strstarts(symname, "__ksymtab_"))

is met. The else-part of the assignment is the dead code.

Move the export_from_secname() call to where it is used.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

+4 -6
+4 -6
scripts/mod/modpost.c
··· 684 684 static void handle_symbol(struct module *mod, struct elf_info *info, 685 685 const Elf_Sym *sym, const char *symname) 686 686 { 687 - enum export export; 688 687 const char *name; 689 - 690 - if (strstarts(symname, "__ksymtab")) 691 - export = export_from_secname(info, get_secindex(info, sym)); 692 - else 693 - export = export_unknown; 694 688 695 689 switch (sym->st_shndx) { 696 690 case SHN_COMMON: ··· 720 726 default: 721 727 /* All exported symbols */ 722 728 if (strstarts(symname, "__ksymtab_")) { 729 + enum export export; 730 + 723 731 name = symname + strlen("__ksymtab_"); 732 + export = export_from_secname(info, 733 + get_secindex(info, sym)); 724 734 sym_add_exported(name, mod, export); 725 735 } 726 736 if (strcmp(symname, "init_module") == 0)