mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 16:20:55 +07:00
module: return bool from within_module*()
The within_module*() functions return only true or false. Let's use bool as the return type. Note that it should not change kABI because these are inline functions. Signed-off-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
9b20a352d7
commit
76681c8faa
@ -396,19 +396,21 @@ bool is_module_address(unsigned long addr);
|
|||||||
bool is_module_percpu_address(unsigned long addr);
|
bool is_module_percpu_address(unsigned long addr);
|
||||||
bool is_module_text_address(unsigned long addr);
|
bool is_module_text_address(unsigned long addr);
|
||||||
|
|
||||||
static inline int within_module_core(unsigned long addr, const struct module *mod)
|
static inline bool within_module_core(unsigned long addr,
|
||||||
|
const struct module *mod)
|
||||||
{
|
{
|
||||||
return (unsigned long)mod->module_core <= addr &&
|
return (unsigned long)mod->module_core <= addr &&
|
||||||
addr < (unsigned long)mod->module_core + mod->core_size;
|
addr < (unsigned long)mod->module_core + mod->core_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int within_module_init(unsigned long addr, const struct module *mod)
|
static inline bool within_module_init(unsigned long addr,
|
||||||
|
const struct module *mod)
|
||||||
{
|
{
|
||||||
return (unsigned long)mod->module_init <= addr &&
|
return (unsigned long)mod->module_init <= addr &&
|
||||||
addr < (unsigned long)mod->module_init + mod->init_size;
|
addr < (unsigned long)mod->module_init + mod->init_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int within_module(unsigned long addr, const struct module *mod)
|
static inline bool within_module(unsigned long addr, const struct module *mod)
|
||||||
{
|
{
|
||||||
return within_module_init(addr, mod) || within_module_core(addr, mod);
|
return within_module_init(addr, mod) || within_module_core(addr, mod);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user