From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:33031 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726683AbeJaDSF (ORCPT ); Tue, 30 Oct 2018 23:18:05 -0400 Date: Tue, 30 Oct 2018 11:23:30 -0700 From: Guenter Roeck To: Geert Uytterhoeven Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , Jean Delvare , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-hwmon@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: (ibmpowernv) Remove bogus __init annotations Message-ID: <20181030182330.GA25641@roeck-us.net> References: <20181028171651.30751-1-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181028171651.30751-1-geert@linux-m68k.org> Sender: linux-hwmon-owner@vger.kernel.org List-Id: linux-hwmon@vger.kernel.org On Sun, Oct 28, 2018 at 06:16:51PM +0100, Geert Uytterhoeven wrote: > If gcc decides not to inline make_sensor_label(): > > WARNING: vmlinux.o(.text+0x4df549c): Section mismatch in reference from the function .create_device_attrs() to the function .init.text:.make_sensor_label() > The function .create_device_attrs() references > the function __init .make_sensor_label(). > This is often because .create_device_attrs lacks a __init > annotation or the annotation of .make_sensor_label is wrong. > > As .probe() can be called after freeing of __init memory, all __init > annotiations in the driver are bogus, and should be removed. > > Signed-off-by: Geert Uytterhoeven Applied. Thanks, Guenter > --- > Compile-tested only. > --- > drivers/hwmon/ibmpowernv.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c > index 0ccca87f527191dc..293dd1c6c7b36ef2 100644 > --- a/drivers/hwmon/ibmpowernv.c > +++ b/drivers/hwmon/ibmpowernv.c > @@ -181,7 +181,7 @@ static ssize_t show_label(struct device *dev, struct device_attribute *devattr, > return sprintf(buf, "%s\n", sdata->label); > } > > -static int __init get_logical_cpu(int hwcpu) > +static int get_logical_cpu(int hwcpu) > { > int cpu; > > @@ -192,9 +192,8 @@ static int __init get_logical_cpu(int hwcpu) > return -ENOENT; > } > > -static void __init make_sensor_label(struct device_node *np, > - struct sensor_data *sdata, > - const char *label) > +static void make_sensor_label(struct device_node *np, > + struct sensor_data *sdata, const char *label) > { > u32 id; > size_t n;