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);
 
 
        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);
        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);
        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);
        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;