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>
This commit is contained in:
parent
3a611c3cfb
commit
9b20a352d7
2 changed files with 9 additions and 8 deletions
|
|
@ -408,6 +408,11 @@ static inline int within_module_init(unsigned long addr, const struct module *mo
|
|||
addr < (unsigned long)mod->module_init + mod->init_size;
|
||||
}
|
||||
|
||||
static inline int within_module(unsigned long addr, const struct module *mod)
|
||||
{
|
||||
return within_module_init(addr, mod) || within_module_core(addr, mod);
|
||||
}
|
||||
|
||||
/* Search for module by name: must hold module_mutex. */
|
||||
struct module *find_module(const char *name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue