Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbbKIITt (ORCPT ); Mon, 9 Nov 2015 03:19:49 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:50815 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbbKIITs (ORCPT ); Mon, 9 Nov 2015 03:19:48 -0500 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: oberpar@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] gcov: use within_module() helper. To: Rusty Russell , linux-kernel@vger.kernel.org References: <1447043037-10833-1-git-send-email-rusty@rustcorp.com.au> <1447043037-10833-3-git-send-email-rusty@rustcorp.com.au> Cc: Josh Poimboeuf , Peter Zijlstra From: Peter Oberparleiter Message-ID: <5640571F.2040609@linux.vnet.ibm.com> Date: Mon, 9 Nov 2015 09:19:43 +0100 MIME-Version: 1.0 In-Reply-To: <1447043037-10833-3-git-send-email-rusty@rustcorp.com.au> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15110908-0017-0000-0000-00000621C3B4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1671 Lines: 43 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 > Signed-off-by: Rusty Russell > --- > 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 -- 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/