EXPORT_UNUSED_SYMBOL* is not actually used anywhere. Remove the unused functionality as we generally just remove unused code anyway.
Showing the changes to kernel (1 of 24 files). Show all
Unified · Split
| @@ -410,14 +410,6 @@ extern const struct kernel_symbol __start___ksymtab_gpl[]; · 409 unmodified lines | ||
| 410 | 410 | extern const struct kernel_symbol __stop___ksymtab_gpl[]; |
| 411 | 411 | extern const s32 __start___kcrctab[]; |
| 412 | 412 | 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 | |
| 421 | 413 | |
| 422 | 414 | #ifndef CONFIG_MODVERSIONS |
| 423 | 415 | #define symversion(base, idx) NULL |
| @@ -432,7 +424,6 @@ struct symsearch { · 8 unmodified lines | ||
| 432 | 424 | NOT_GPL_ONLY, |
| 433 | 425 | GPL_ONLY, |
| 434 | 426 | } license; |
| 435 | − bool unused; | |
| 436 | 427 | }; |
| 437 | 428 | |
| 438 | 429 | struct find_symbol_arg { |
| @@ -456,19 +447,6 @@ static bool check_exported_symbol(const struct symsearch *syms, · 17 unmodified lines | ||
| 456 | 447 | |
| 457 | 448 | if (!fsa->gplok && syms->license == GPL_ONLY) |
| 458 | 449 | 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 | − | |
| 472 | 450 | fsa->owner = owner; |
| 473 | 451 | fsa->crc = symversion(syms->crcs, symnum); |
| 474 | 452 | fsa->sym = &syms->start[symnum]; |
| @@ -535,18 +513,10 @@ static bool find_symbol(struct find_symbol_arg *fsa) · 60 unmodified lines | ||
| 535 | 513 | { |
| 536 | 514 | static const struct symsearch arr[] = { |
| 537 | 515 | { __start___ksymtab, __stop___ksymtab, __start___kcrctab, |
| 538 | − NOT_GPL_ONLY, false }, | |
| 516 | + NOT_GPL_ONLY }, | |
| 539 | 517 | { __start___ksymtab_gpl, __stop___ksymtab_gpl, |
| 540 | 518 | __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 }, | |
| 550 | 520 | }; |
| 551 | 521 | struct module *mod; |
| 552 | 522 | unsigned int i; |
| @@ -561,20 +531,10 @@ static bool find_symbol(struct find_symbol_arg *fsa) · 8 unmodified lines | ||
| 561 | 531 | lockdep_is_held(&module_mutex)) { |
| 562 | 532 | struct symsearch arr[] = { |
| 563 | 533 | { mod->syms, mod->syms + mod->num_syms, mod->crcs, |
| 564 | − NOT_GPL_ONLY, false }, | |
| 534 | + NOT_GPL_ONLY }, | |
| 565 | 535 | { mod->gpl_syms, mod->gpl_syms + mod->num_gpl_syms, |
| 566 | 536 | 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 }, | |
| 578 | 538 | }; |
| 579 | 539 | |
| 580 | 540 | if (mod->state == MODULE_STATE_UNFORMED) |
| @@ -2274,10 +2234,6 @@ static int verify_exported_symbols(struct module *mod) · 1693 unmodified lines | ||
| 2274 | 2234 | } arr[] = { |
| 2275 | 2235 | { mod->syms, mod->num_syms }, |
| 2276 | 2236 | { 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 | |
| 2281 | 2237 | }; |
| 2282 | 2238 | |
| 2283 | 2239 | 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 | ||
| 3290 | 3246 | &mod->num_gpl_syms); |
| 3291 | 3247 | mod->gpl_crcs = section_addr(info, "__kcrctab_gpl"); |
| 3292 | 3248 | |
| 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 | |
| 3303 | 3249 | #ifdef CONFIG_CONSTRUCTORS |
| 3304 | 3250 | mod->ctors = section_objs(info, ".ctors", |
| 3305 | 3251 | sizeof(*mod->ctors), &mod->num_ctors); |
| @@ -3480,13 +3426,8 @@ static int check_module_license_and_versions(struct module *mod) · 174 unmodified lines | ||
| 3480 | 3426 | pr_warn("%s: module license taints kernel.\n", mod->name); |
| 3481 | 3427 | |
| 3482 | 3428 | #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)) { | |
| 3490 | 3431 | return try_to_force_load(mod, |
| 3491 | 3432 | "no versions for exported symbols"); |
| 3492 | 3433 | } |