History

module: remove EXPORT_UNUSED_SYMBOL*

EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the unused functionality as we generally just remove unused code anyway.

Christoph Hellwig committed 5 years ago

Commit 36794821 parent f1c3d7324 files · +13 −193Browse files

Showing the changes to kernel (1 of 24 files). Show all

Unified · Split

kernel/module.c+6−65
@@ -410,14 +410,6 @@ extern const struct kernel_symbol __start___ksymtab_gpl[]; · 409 unmodified lines
410410 extern const struct kernel_symbol __stop___ksymtab_gpl[];
411411 extern const s32 __start___kcrctab[];
412412 extern const s32 __start___kcrctab_gpl[];
413−#ifdef CONFIG_UNUSED_SYMBOLS
414−extern const struct kernel_symbol __start___ksymtab_unused[];
415−extern const struct kernel_symbol __stop___ksymtab_unused[];
416−extern const struct kernel_symbol __start___ksymtab_unused_gpl[];
417−extern const struct kernel_symbol __stop___ksymtab_unused_gpl[];
418−extern const s32 __start___kcrctab_unused[];
419−extern const s32 __start___kcrctab_unused_gpl[];
420−#endif
421413
422414 #ifndef CONFIG_MODVERSIONS
423415 #define symversion(base, idx) NULL
@@ -432,7 +424,6 @@ struct symsearch { · 8 unmodified lines
432424 NOT_GPL_ONLY,
433425 GPL_ONLY,
434426 } license;
435− bool unused;
436427 };
437428
438429 struct find_symbol_arg {
@@ -456,19 +447,6 @@ static bool check_exported_symbol(const struct symsearch *syms, · 17 unmodified lines
456447
457448 if (!fsa->gplok && syms->license == GPL_ONLY)
458449 return false;
459−
460−#ifdef CONFIG_UNUSED_SYMBOLS
461− if (syms->unused && fsa->warn) {
462− pr_warn("Symbol %s is marked as UNUSED, however this module is "
463− "using it.\n", fsa->name);
464− pr_warn("This symbol will go away in the future.\n");
465− pr_warn("Please evaluate if this is the right api to use and "
466− "if it really is, submit a report to the linux kernel "
467− "mailing list together with submitting your code for "
468− "inclusion.\n");
469− }
470−#endif
471−
472450 fsa->owner = owner;
473451 fsa->crc = symversion(syms->crcs, symnum);
474452 fsa->sym = &syms->start[symnum];
@@ -535,18 +513,10 @@ static bool find_symbol(struct find_symbol_arg *fsa) · 60 unmodified lines
535513 {
536514 static const struct symsearch arr[] = {
537515 { __start___ksymtab, __stop___ksymtab, __start___kcrctab,
538− NOT_GPL_ONLY, false },
516+ NOT_GPL_ONLY },
539517 { __start___ksymtab_gpl, __stop___ksymtab_gpl,
540518 __start___kcrctab_gpl,
541− GPL_ONLY, false },
542−#ifdef CONFIG_UNUSED_SYMBOLS
543− { __start___ksymtab_unused, __stop___ksymtab_unused,
544− __start___kcrctab_unused,
545− NOT_GPL_ONLY, true },
546− { __start___ksymtab_unused_gpl, __stop___ksymtab_unused_gpl,
547− __start___kcrctab_unused_gpl,
548− GPL_ONLY, true },
549−#endif
519+ GPL_ONLY },
550520 };
551521 struct module *mod;
552522 unsigned int i;
@@ -561,20 +531,10 @@ static bool find_symbol(struct find_symbol_arg *fsa) · 8 unmodified lines
561531 lockdep_is_held(&module_mutex)) {
562532 struct symsearch arr[] = {
563533 { mod->syms, mod->syms + mod->num_syms, mod->crcs,
564− NOT_GPL_ONLY, false },
534+ NOT_GPL_ONLY },
565535 { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms,
566536 mod->gpl_crcs,
567− GPL_ONLY, false },
568−#ifdef CONFIG_UNUSED_SYMBOLS
569− { mod->unused_syms,
570− mod->unused_syms + mod->num_unused_syms,
571− mod->unused_crcs,
572− NOT_GPL_ONLY, true },
573− { mod->unused_gpl_syms,
574− mod->unused_gpl_syms + mod->num_unused_gpl_syms,
575− mod->unused_gpl_crcs,
576− GPL_ONLY, true },
577−#endif
537+ GPL_ONLY },
578538 };
579539
580540 if (mod->state == MODULE_STATE_UNFORMED)
@@ -2274,10 +2234,6 @@ static int verify_exported_symbols(struct module *mod) · 1693 unmodified lines
22742234 } arr[] = {
22752235 { mod->syms, mod->num_syms },
22762236 { mod->gpl_syms, mod->num_gpl_syms },
2277−#ifdef CONFIG_UNUSED_SYMBOLS
2278− { mod->unused_syms, mod->num_unused_syms },
2279− { mod->unused_gpl_syms, mod->num_unused_gpl_syms },
2280−#endif
22812237 };
22822238
22832239 for (i = 0; i < ARRAY_SIZE(arr); i++) {
@@ -3290,16 +3246,6 @@ static int find_module_sections(struct module *mod, struct load_info *info) · 1006 unmodified lines
32903246 &mod->num_gpl_syms);
32913247 mod->gpl_crcs = section_addr(info, "__kcrctab_gpl");
32923248
3293−#ifdef CONFIG_UNUSED_SYMBOLS
3294− mod->unused_syms = section_objs(info, "__ksymtab_unused",
3295− sizeof(*mod->unused_syms),
3296− &mod->num_unused_syms);
3297− mod->unused_crcs = section_addr(info, "__kcrctab_unused");
3298− mod->unused_gpl_syms = section_objs(info, "__ksymtab_unused_gpl",
3299− sizeof(*mod->unused_gpl_syms),
3300− &mod->num_unused_gpl_syms);
3301− mod->unused_gpl_crcs = section_addr(info, "__kcrctab_unused_gpl");
3302−#endif
33033249 #ifdef CONFIG_CONSTRUCTORS
33043250 mod->ctors = section_objs(info, ".ctors",
33053251 sizeof(*mod->ctors), &mod->num_ctors);
@@ -3480,13 +3426,8 @@ static int check_module_license_and_versions(struct module *mod) · 174 unmodified lines
34803426 pr_warn("%s: module license taints kernel.\n", mod->name);
34813427
34823428 #ifdef CONFIG_MODVERSIONS
3483− if ((mod->num_syms && !mod->crcs)
3484− || (mod->num_gpl_syms && !mod->gpl_crcs)
3485−#ifdef CONFIG_UNUSED_SYMBOLS
3486− || (mod->num_unused_syms && !mod->unused_crcs)
3487− || (mod->num_unused_gpl_syms && !mod->unused_gpl_crcs)
3488−#endif
3489− ) {
3429+ if ((mod->num_syms && !mod->crcs) ||
3430+ (mod->num_gpl_syms && !mod->gpl_crcs)) {
34903431 return try_to_force_load(mod,
34913432 "no versions for exported symbols");
34923433 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t