Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966023AbdIYXUW (ORCPT ); Mon, 25 Sep 2017 19:20:22 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:53493 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965659AbdIYXUU (ORCPT ); Mon, 25 Sep 2017 19:20:20 -0400 X-Google-Smtp-Source: AOwi7QDXbxDm8EF/jK3Ekv7qFdIamry8GBQv1SsfAtmVYMzYVzPH/wcNPYIRgIC1cgVMkR0mVK6V/A== Date: Mon, 25 Sep 2017 16:20:19 -0700 From: Viresh Kumar To: Prasad Sodagudi Cc: gregkh@linuxfoundation.org, juri.lelli@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arch_topology: Fix section miss match warning due to free_raw_capacity() Message-ID: <20170925232019.GD3053@ubuntu> References: <1506379904-1007-1-git-send-email-psodagud@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506379904-1007-1-git-send-email-psodagud@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1249 Lines: 37 On 25-09-17, 15:51, Prasad Sodagudi wrote: > Remove the __init annotation from free_raw_capacity() to avoid > the following warning. > > The function init_cpu_capacity_callback() references the > function __init free_raw_capacity(). > WARNING: vmlinux.o(.text+0x425cc0): Section mismatch in reference > from the function init_cpu_capacity_callback() to the function > .init.text:free_raw_capacity(). > > Signed-off-by: Prasad Sodagudi > --- > drivers/base/arch_topology.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index 41be9ff..3da53cc 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -96,7 +96,7 @@ static int register_cpu_capacity_sysctl(void) > static u32 capacity_scale; > static u32 *raw_capacity; > > -static int __init free_raw_capacity(void) > +static int free_raw_capacity(void) > { > kfree(raw_capacity); > raw_capacity = NULL; So we need the __init thing only when cpufreq support isn't there in the kernel and I am not sure if we want to add more ifdef hackery in the declaration of free_raw_capacity(). Acked-by: Viresh Kumar -- viresh