each_symbol_in_section just contains a trivial loop over its arguments. Just open code the loop in the two callers.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -428,30 +428,13 @@ extern const s32 __start___kcrctab_unused_gpl[]; · 427 unmodified lines | ||
| 428 | 428 | #define symversion(base, idx) ((base != NULL) ? ((base) + (idx)) : NULL) |
| 429 | 429 | #endif |
| 430 | 430 | |
| 431 | −static bool each_symbol_in_section(const struct symsearch *arr, | |
| 432 | − unsigned int arrsize, | |
| 433 | − struct module *owner, | |
| 434 | − bool (*fn)(const struct symsearch *syms, | |
| 435 | − struct module *owner, | |
| 436 | − void *data), | |
| 437 | − void *data) | |
| 438 | −{ | |
| 439 | − unsigned int j; | |
| 440 | − | |
| 441 | − for (j = 0; j < arrsize; j++) { | |
| 442 | − if (fn(&arr[j], owner, data)) | |
| 443 | − return true; | |
| 444 | − } | |
| 445 | − | |
| 446 | − return false; | |
| 447 | −} | |
| 448 | − | |
| 449 | 431 | /* Returns true as soon as fn returns true, otherwise false. */ |
| 450 | 432 | static bool each_symbol_section(bool (*fn)(const struct symsearch *arr, |
| 451 | 433 | struct module *owner, |
| 452 | 434 | void *data), |
| 453 | 435 | void *data) |
| 454 | 436 | { |
| 437 | + unsigned int i; | |
| 455 | 438 | struct module *mod; |
| 456 | 439 | static const struct symsearch arr[] = { |
| 457 | 440 | { __start___ksymtab, __stop___ksymtab, __start___kcrctab, |
| @@ -474,8 +457,9 @@ static bool each_symbol_section(bool (*fn)(const struct symsearch *arr, · 16 unmodified lines | ||
| 474 | 457 | |
| 475 | 458 | module_assert_mutex_or_preempt(); |
| 476 | 459 | |
| 477 | − if (each_symbol_in_section(arr, ARRAY_SIZE(arr), NULL, fn, data)) | |
| 478 | − return true; | |
| 460 | + for (i = 0; i < ARRAY_SIZE(arr); i++) | |
| 461 | + if (fn(&arr[i], NULL, data)) | |
| 462 | + return true; | |
| 479 | 463 | |
| 480 | 464 | list_for_each_entry_rcu(mod, &modules, list, |
| 481 | 465 | lockdep_is_held(&module_mutex)) { |
| @@ -504,8 +488,9 @@ static bool each_symbol_section(bool (*fn)(const struct symsearch *arr, · 22 unmodified lines | ||
| 504 | 488 | if (mod->state == MODULE_STATE_UNFORMED) |
| 505 | 489 | continue; |
| 506 | 490 | |
| 507 | − if (each_symbol_in_section(arr, ARRAY_SIZE(arr), mod, fn, data)) | |
| 508 | − return true; | |
| 491 | + for (i = 0; i < ARRAY_SIZE(arr); i++) | |
| 492 | + if (fn(&arr[i], mod, data)) | |
| 493 | + return true; | |
| 509 | 494 | } |
| 510 | 495 | return false; |
| 511 | 496 | } |