diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2015-11-25 18:13:08 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-12-04 16:46:25 -0500 |
commit | c65abf358f211c3f88c8ed714dff25775ab49fc1 (patch) | |
tree | b5631ffa6db131339fd3e9cf3c681dac3df7100c | |
parent | 20ef10c1b3068f105004e247d8e7dd8120fa4b9a (diff) |
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: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | kernel/gcov/base.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c index 7080ae1eb6c1..2f9df37940a0 100644 --- a/kernel/gcov/base.c +++ b/kernel/gcov/base.c | |||
@@ -123,11 +123,6 @@ void gcov_enable_events(void) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | #ifdef CONFIG_MODULES | 125 | #ifdef CONFIG_MODULES |
126 | static inline int within(void *addr, void *start, unsigned long size) | ||
127 | { | ||
128 | return ((addr >= start) && (addr < start + size)); | ||
129 | } | ||
130 | |||
131 | /* Update list and generate events when modules are unloaded. */ | 126 | /* Update list and generate events when modules are unloaded. */ |
132 | static int gcov_module_notifier(struct notifier_block *nb, unsigned long event, | 127 | static int gcov_module_notifier(struct notifier_block *nb, unsigned long event, |
133 | void *data) | 128 | void *data) |
@@ -142,7 +137,7 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event, | |||
142 | 137 | ||
143 | /* Remove entries located in module from linked list. */ | 138 | /* Remove entries located in module from linked list. */ |
144 | while ((info = gcov_info_next(info))) { | 139 | while ((info = gcov_info_next(info))) { |
145 | if (within(info, mod->module_core, mod->core_size)) { | 140 | if (within_module((unsigned long)info, mod)) { |
146 | gcov_info_unlink(prev, info); | 141 | gcov_info_unlink(prev, info); |
147 | if (gcov_events_enabled) | 142 | if (gcov_events_enabled) |
148 | gcov_event(GCOV_REMOVE, info); | 143 | gcov_event(GCOV_REMOVE, info); |