Skip to content

Commit

Permalink
gcov: use within_module() helper.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
rustyrussell authored and Jiri Kosina committed Dec 4, 2015
1 parent 20ef10c commit c65abf3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kernel/gcov/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ void gcov_enable_events(void)
}

#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. */
static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,
void *data)
Expand All @@ -142,7 +137,7 @@ static int gcov_module_notifier(struct notifier_block *nb, unsigned long event,

/* Remove entries located in module from linked list. */
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);
if (gcov_events_enabled)
gcov_event(GCOV_REMOVE, info);
Expand Down

0 comments on commit c65abf3

Please sign in to comment.