Except for two lockdep asserts module_mutex is only used in module.c. Remove the two asserts given that the functions they are in are not exported and just called from the module code, and mark module_mutex static.
Unified · Split
| @@ -550,8 +550,6 @@ static inline unsigned long kallsyms_symbol_value(const Elf_Sym *sym) · 549 unmodified lines | |||
| 550 | } | 550 | } |
| 551 | #endif | 551 | #endif |
| 552 | 552 | ||
| 553 | extern struct mutex module_mutex; | ||
| 554 | |||
| 555 | /* FIXME: It'd be nice to isolate modules during init, too, so they | 553 | /* FIXME: It'd be nice to isolate modules during init, too, so they |
| 556 | aren't used before they (may) fail. But presently too much code | 554 | aren't used before they (may) fail. But presently too much code |
| 557 | (IDE & SCSI) require entry into the module during init.*/ | 555 | (IDE & SCSI) require entry into the module during init.*/ |
| @@ -87,7 +87,7 @@ · 86 unmodified lines | |||
| 87 | * 3) module_addr_min/module_addr_max. | 87 | * 3) module_addr_min/module_addr_max. |
| 88 | * (delete and add uses RCU list operations). | 88 | * (delete and add uses RCU list operations). |
| 89 | */ | 89 | */ |
| 90 | DEFINE_MUTEX(module_mutex); | 90 | static DEFINE_MUTEX(module_mutex); |
| 91 | static LIST_HEAD(modules); | 91 | static LIST_HEAD(modules); |
| 92 | 92 | ||
| 93 | /* Work queue for freeing init sections in success case */ | 93 | /* Work queue for freeing init sections in success case */ |
| @@ -91,8 +91,6 @@ void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, · 90 unmodified lines | |||
| 91 | char *secstrings; | 91 | char *secstrings; |
| 92 | unsigned int i; | 92 | unsigned int i; |
| 93 | 93 | ||
| 94 | lockdep_assert_held(&module_mutex); | ||
| 95 | |||
| 96 | mod->bug_table = NULL; | 94 | mod->bug_table = NULL; |
| 97 | mod->num_bugs = 0; | 95 | mod->num_bugs = 0; |
| 98 | 96 | ||
| @@ -118,7 +116,6 @@ void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, · 19 unmodified lines | |||
| 118 | 116 | ||
| 119 | void module_bug_cleanup(struct module *mod) | 117 | void module_bug_cleanup(struct module *mod) |
| 120 | { | 118 | { |
| 121 | lockdep_assert_held(&module_mutex); | ||
| 122 | list_del_rcu(&mod->bug_list); | 119 | list_del_rcu(&mod->bug_list); |
| 123 | } | 120 | } |
| 124 | 121 | ||