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
550550 }
551551 #endif
552552
553−extern struct mutex module_mutex;
554−
555553 /* FIXME: It'd be nice to isolate modules during init, too, so they
556554 aren't used before they (may) fail. But presently too much code
557555 (IDE & SCSI) require entry into the module during init.*/
kernel/module.c+1−1
@@ -87,7 +87,7 @@ · 86 unmodified lines
8787 * 3) module_addr_min/module_addr_max.
8888 * (delete and add uses RCU list operations).
8989 */
90−DEFINE_MUTEX(module_mutex);
90+static DEFINE_MUTEX(module_mutex);
9191 static LIST_HEAD(modules);
9292
9393 /* 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
9191 char *secstrings;
9292 unsigned int i;
9393
94− lockdep_assert_held(&module_mutex);
95−
9694 mod->bug_table = NULL;
9795 mod->num_bugs = 0;
9896
@@ -118,7 +116,6 @@ void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, · 19 unmodified lines
118116
119117 void module_bug_cleanup(struct module *mod)
120118 {
121− lockdep_assert_held(&module_mutex);
122119 list_del_rcu(&mod->bug_list);
123120 }
124121

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