Commit c65abf35 authored by Rusty Russell's avatar Rusty Russell Committed by Jiri Kosina

gcov: use within_module() helper.

An exact mapping would be within_module_core(), but at this stage
(MODULE_STATE_GOING) the init section is empty, and this is clearer.
Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 20ef10c1
...@@ -123,11 +123,6 @@ void gcov_enable_events(void) ...@@ -123,11 +123,6 @@ void gcov_enable_events(void)
} }
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
static inline int within(void *addr, void *start, unsigned long size)
{
return ((addr >= start) && (addr < start + size));
}
/* Update list and generate events when modules are unloaded. */ /* Update list and generate events when modules are unloaded. */
static int gcov_module_notifier(struct notifier_block *nb, unsigned long event, static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
void *data) void *data)
...@@ -142,7 +137,7 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event, ...@@ -142,7 +137,7 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
/* Remove entries located in module from linked list. */ /* Remove entries located in module from linked list. */
while ((info = gcov_info_next(info))) { while ((info = gcov_info_next(info))) {
if (within(info, mod->module_core, mod->core_size)) { if (within_module((unsigned long)info, mod)) {
gcov_info_unlink(prev, info); gcov_info_unlink(prev, info);
if (gcov_events_enabled) if (gcov_events_enabled)
gcov_event(GCOV_REMOVE, info); gcov_event(GCOV_REMOVE, info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment