History

module: mark module_mutex static

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.

Christoph Hellwig committed 5 years ago

Commit 922f2a71 parent 3e355203 files · +1 −6Browse files

Unified · Split

3 files
  1. include/linux/module.h +0 −2
  2. kernel/module.c +1 −1
  3. lib/bug.c +0 −3
include/linux/module.h+0−2
@@ -550,8 +550,6 @@ static inline unsigned long kallsyms_symbol_value(const Elf_Sym *sym) · 549 unmodified lines
550}550}
551#endif551#endif
552 552
553extern struct mutex module_mutex;
554
555/* FIXME: It'd be nice to isolate modules during init, too, so they553/* 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 code554 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.*/
kernel/module.c+1−1
@@ -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 */
90DEFINE_MUTEX(module_mutex);90static DEFINE_MUTEX(module_mutex);
91static LIST_HEAD(modules);91static 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 */
lib/bug.c+0−3
@@ -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
119void module_bug_cleanup(struct module *mod)117void 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

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