From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 1/6] arm/setup: Add missing __init to add_boot_module Date: Fri, 16 Jan 2015 16:28:59 +0000 Message-ID: <54B93C4B.9050709@citrix.com> References: <1421425248-8727-1-git-send-email-julien.grall@linaro.org> <1421425248-8727-2-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YC9lr-0007pH-0y for xen-devel@lists.xenproject.org; Fri, 16 Jan 2015 16:29:15 +0000 In-Reply-To: <1421425248-8727-2-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall , xen-devel@lists.xenproject.org Cc: tim@xen.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On 16/01/15 16:20, Julien Grall wrote: > add_boot_module is calling a function which lies in the init section. > Furthermore, it's only used during Xen boot. > > Signed-off-by: Julien Grall > --- > xen/arch/arm/setup.c | 6 +++--- > xen/include/asm-arm/setup.h | 8 ++++---- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c > index f49569d..5fc27ce0 100644 > --- a/xen/arch/arm/setup.c > +++ b/xen/arch/arm/setup.c > @@ -185,9 +185,9 @@ static void dt_unreserved_regions(paddr_t s, paddr_t e, > cb(s, e); > } > > -struct bootmodule *add_boot_module(bootmodule_kind kind, > - paddr_t start, paddr_t size, > - const char *cmdline) > +struct bootmodule __init *add_boot_module(bootmodule_kind kind, __init should be after the type, rather than spliced into the middle of it. "struct bootmodule * __init add_boot_module(...)" should work. However, only static functions should be annotated at the definition. non-static functions can get their annotation from the declaration alone. > + paddr_t start, paddr_t size, > + const char *cmdline) > { > struct bootmodules *mods = &bootinfo.modules; > struct bootmodule *mod; > diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h > index ba5a67d..ed2ba16 100644 > --- a/xen/include/asm-arm/setup.h > +++ b/xen/include/asm-arm/setup.h > @@ -60,10 +60,10 @@ void discard_initial_modules(void); > size_t __init boot_fdt_info(const void *fdt, paddr_t paddr); > const char __init *boot_fdt_cmdline(const void *fdt); > > -struct bootmodule *add_boot_module(bootmodule_kind kind, > - paddr_t start, paddr_t size, > - const char *cmdline); > -struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind); > +struct bootmodule __init *add_boot_module(bootmodule_kind kind, > + paddr_t start, paddr_t size, > + const char *cmdline); > +struct bootmodule __init *boot_module_find_by_kind(bootmodule_kind kind); > const char * __init boot_module_kind_as_string(bootmodule_kind kind); > > #endif