Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265329 > unrolled thread

[PATCH 2/4] gcov: use within_module() helper.

Started byRusty Russell <rusty@rustcorp.com.au>
First post2015-11-09 05:30 +0100
Last post2015-11-09 09:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/4] gcov: use within_module() helper. Rusty Russell <rusty@rustcorp.com.au> - 2015-11-09 05:30 +0100
    Re: [PATCH 2/4] gcov: use within_module() helper. Peter Oberparleiter <oberpar@linux.vnet.ibm.com> - 2015-11-09 09:20 +0100

#1265329 — [PATCH 2/4] gcov: use within_module() helper.

FromRusty Russell <rusty@rustcorp.com.au>
Date2015-11-09 05:30 +0100
Subject[PATCH 2/4] gcov: use within_module() helper.
Message-ID<qsMfE-1po-5@gated-at.bofh.it>
An exact mapping would be within_module_core(), but at this stage
(MODULE_STATE_GOING) the init section is empty, and this is clearer.

Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 kernel/gcov/base.c | 7 +------
 1 file changed, 1 insertion(+), 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)
 }
 
 #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)
@@ -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);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1265443

FromPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Date2015-11-09 09:20 +0100
Message-ID<qsPQe-3Rn-9@gated-at.bofh.it>
In reply to#1265329
On 09.11.2015 05:23, Rusty Russell wrote:
> An exact mapping would be within_module_core(), but at this stage
> (MODULE_STATE_GOING) the init section is empty, and this is clearer.
> 
> Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> ---
>  kernel/gcov/base.c | 7 +------
>  1 file changed, 1 insertion(+), 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)
>  }
> 
>  #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)
> @@ -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);

Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web