diff options
author | Petr Mladek <pmladek@suse.cz> | 2014-07-26 17:54:01 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-07-27 07:22:43 -0400 |
commit | 9b20a352d78a7651aa68a9220f77ccb03009d892 (patch) | |
tree | 35db0592980536ae7cde8472d21a27edf51b7fd5 /include/linux/module.h | |
parent | 3a611c3cfba2106aed3187b90903855e776e2761 (diff) |
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 'include/linux/module.h')
-rw-r--r-- | include/linux/module.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index f520a767c86c..61d8fb2d0873 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -408,6 +408,11 @@ static inline int within_module_init(unsigned long addr, const struct module *mo | |||
408 | addr < (unsigned long)mod->module_init + mod->init_size; | 408 | addr < (unsigned long)mod->module_init + mod->init_size; |
409 | } | 409 | } |
410 | 410 | ||
411 | static inline int within_module(unsigned long addr, const struct module *mod) | ||
412 | { | ||
413 | return within_module_init(addr, mod) || within_module_core(addr, mod); | ||
414 | } | ||
415 | |||
411 | /* Search for module by name: must hold module_mutex. */ | 416 | /* Search for module by name: must hold module_mutex. */ |
412 | struct module *find_module(const char *name); | 417 | struct module *find_module(const char *name); |
413 | 418 | ||