summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2014-07-27 07:24:01 +0930
committerRusty Russell <rusty@rustcorp.com.au>2014-07-27 20:52:43 +0930
commit9b20a352d78a7651aa68a9220f77ccb03009d892 (patch)
tree35db0592980536ae7cde8472d21a27edf51b7fd5 /kernel/module.c
parent3a611c3cfba2106aed3187b90903855e776e2761 (diff)
downloadop-kernel-dev-9b20a352d78a7651aa68a9220f77ccb03009d892.zip
op-kernel-dev-9b20a352d78a7651aa68a9220f77ccb03009d892.tar.gz
module: add within_module() function
It is just a small optimization that allows to replace few occurrences of within_module_init() || within_module_core() with a single call. Signed-off-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 81e727c..e87fdd2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3448,8 +3448,7 @@ const char *module_address_lookup(unsigned long addr,
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
- if (within_module_init(addr, mod) ||
- within_module_core(addr, mod)) {
+ if (within_module(addr, mod)) {
if (modname)
*modname = mod->name;
ret = get_ksymbol(mod, addr, size, offset);
@@ -3473,8 +3472,7 @@ int lookup_module_symbol_name(unsigned long addr, char *symname)
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
- if (within_module_init(addr, mod) ||
- within_module_core(addr, mod)) {
+ if (within_module(addr, mod)) {
const char *sym;
sym = get_ksymbol(mod, addr, NULL, NULL);
@@ -3499,8 +3497,7 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size,
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
- if (within_module_init(addr, mod) ||
- within_module_core(addr, mod)) {
+ if (within_module(addr, mod)) {
const char *sym;
sym = get_ksymbol(mod, addr, size, offset);
@@ -3764,8 +3761,7 @@ struct module *__module_address(unsigned long addr)
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
- if (within_module_core(addr, mod)
- || within_module_init(addr, mod))
+ if (within_module(addr, mod))
return mod;
}
return NULL;
OpenPOWER on IntegriCloud