Skip to content

Commit c65abf3

Browse files
rustyrussellJiri Kosina
authored andcommitted
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>
1 parent 20ef10c commit c65abf3

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎kernel/gcov/base.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ void gcov_enable_events(void)
123123
}
124124

125125
#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-
131126
/* Update list and generate events when modules are unloaded. */
132127
static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
133128
void *data)
@@ -142,7 +137,7 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
142137

143138
/* Remove entries located in module from linked list. */
144139
while ((info = gcov_info_next(info))) {
145-
if (within(info, mod->module_core, mod->core_size)) {
140+
if (within_module((unsigned long)info, mod)) {
146141
gcov_info_unlink(prev, info);
147142
if (gcov_events_enabled)
148143
gcov_event(GCOV_REMOVE, info);

0 commit comments

Comments
 (0)