diff mbox

ARM: OMAP: Get rid of section mismatch warnings

Message ID 20110526135533.GA25841@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux May 26, 2011, 1:55 p.m. UTC
On Thu, May 26, 2011 at 06:37:32AM -0700, Tony Lindgren wrote:
> * Santosh Shilimkar <santosh.shilimkar@ti.com> [110526 05:56]:
> > On 5/26/2011 6:30 PM, Silesh C V wrote:
> > >Get rid of the following and 8 other similar section mismatch
> > >warnings
> > >
> > I send this [1] patch a month back. It's still not considered
> > though even after reminder.
> > 
> > [1] https://patchwork.kernel.org/patch/684831/
> 
> Applying now into devel-fixes with additional fixes from Silesh.
> Updated patch below.

I also have this from a while back.  There's also some nastyness in
twl4030-power.c which requires basically s/__init/__devinit/ to almost
the entire file.

8<--------
From: Russell King <rmk+kernel@arm.linux.org.uk>

Fix various section mismatch warnings:

WARNING: arch/arm/plat-omap/built-in.o(.devinit.text+0x46c): Section mismatch in reference from the function omap_gpio_probe() to the function .init.text:omap_gpio_chip_init()
The function __devinit omap_gpio_probe() references
a function __init omap_gpio_chip_init().
If omap_gpio_chip_init is only used by omap_gpio_probe then
annotate omap_gpio_chip_init with a matching annotation.

WARNING: arch/arm/mach-omap2/built-in.o(.text+0x423c): Section mismatch in reference from the function pm_dbg_regset_init() to the function .init.text:pm_dbg_init()
The function pm_dbg_regset_init() references
the function __init pm_dbg_init().
This is often because pm_dbg_regset_init lacks a __init
annotation or the annotation of pm_dbg_init is wrong.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--
 arch/arm/mach-omap2/pm-debug.c |    4 ++--
 arch/arm/plat-omap/gpio.c      |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Tony Lindgren May 27, 2011, 10:54 a.m. UTC | #1
* Russell King - ARM Linux <linux@arm.linux.org.uk> [110526 16:51]:
> On Thu, May 26, 2011 at 06:37:32AM -0700, Tony Lindgren wrote:
> > * Santosh Shilimkar <santosh.shilimkar@ti.com> [110526 05:56]:
> > > On 5/26/2011 6:30 PM, Silesh C V wrote:
> > > >Get rid of the following and 8 other similar section mismatch
> > > >warnings
> > > >
> > > I send this [1] patch a month back. It's still not considered
> > > though even after reminder.
> > > 
> > > [1] https://patchwork.kernel.org/patch/684831/
> > 
> > Applying now into devel-fixes with additional fixes from Silesh.
> > Updated patch below.
> 
> I also have this from a while back.  There's also some nastyness in
> twl4030-power.c which requires basically s/__init/__devinit/ to almost
> the entire file.

OK thanks. Kevin, can you queue this fix? Assuming the move of omap
gpio to drivers/gpio happens this merge window, this needs to be
updated for the path.

Regards,

Tony
 
> 8<--------
> From: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Fix various section mismatch warnings:
> 
> WARNING: arch/arm/plat-omap/built-in.o(.devinit.text+0x46c): Section mismatch in reference from the function omap_gpio_probe() to the function .init.text:omap_gpio_chip_init()
> The function __devinit omap_gpio_probe() references
> a function __init omap_gpio_chip_init().
> If omap_gpio_chip_init is only used by omap_gpio_probe then
> annotate omap_gpio_chip_init with a matching annotation.
> 
> WARNING: arch/arm/mach-omap2/built-in.o(.text+0x423c): Section mismatch in reference from the function pm_dbg_regset_init() to the function .init.text:pm_dbg_init()
> The function pm_dbg_regset_init() references
> the function __init pm_dbg_init().
> This is often because pm_dbg_regset_init lacks a __init
> annotation or the annotation of pm_dbg_init is wrong.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> --
>  arch/arm/mach-omap2/pm-debug.c |    4 ++--
>  arch/arm/plat-omap/gpio.c      |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index 971d186..3800ee0 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -1629,7 +1629,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank, int id)
>  	}
>  }
>  
> -static void __init omap_gpio_chip_init(struct gpio_bank *bank)
> +static void __devinit omap_gpio_chip_init(struct gpio_bank *bank)
>  {
>  	int j;
>  	static int gpio;
> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
> index 125f565..169e930 100644
> --- a/arch/arm/mach-omap2/pm-debug.c
> +++ b/arch/arm/mach-omap2/pm-debug.c
> @@ -189,7 +189,7 @@ static struct dentry *pm_dbg_dir;
>  
>  static int pm_dbg_init_done;
>  
> -static int __init pm_dbg_init(void);
> +static int pm_dbg_init(void);
>  
>  enum {
>  	DEBUG_FILE_COUNTERS = 0,
> @@ -595,7 +595,7 @@ static int option_set(void *data, u64 val)
>  
>  DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n");
>  
> -static int __init pm_dbg_init(void)
> +static int pm_dbg_init(void)
>  {
>  	int i;
>  	struct dentry *d;
>
Kevin Hilman May 27, 2011, 8:51 p.m. UTC | #2
Tony Lindgren <tony@atomide.com> writes:

> * Russell King - ARM Linux <linux@arm.linux.org.uk> [110526 16:51]:
>> On Thu, May 26, 2011 at 06:37:32AM -0700, Tony Lindgren wrote:
>> > * Santosh Shilimkar <santosh.shilimkar@ti.com> [110526 05:56]:
>> > > On 5/26/2011 6:30 PM, Silesh C V wrote:
>> > > >Get rid of the following and 8 other similar section mismatch
>> > > >warnings
>> > > >
>> > > I send this [1] patch a month back. It's still not considered
>> > > though even after reminder.
>> > > 
>> > > [1] https://patchwork.kernel.org/patch/684831/
>> > 
>> > Applying now into devel-fixes with additional fixes from Silesh.
>> > Updated patch below.
>> 
>> I also have this from a while back.  There's also some nastyness in
>> twl4030-power.c which requires basically s/__init/__devinit/ to almost
>> the entire file.
>
> OK thanks. Kevin, can you queue this fix? Assuming the move of omap
> gpio to drivers/gpio happens this merge window, this needs to be
> updated for the path.

Yeah, I'll take care of this.

GPIO move is now merged for 2.6.40, so I'll queue this as a fix for
the first -rc cycle.

Kevin
diff mbox

Patch

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 971d186..3800ee0 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1629,7 +1629,7 @@  static void omap_gpio_mod_init(struct gpio_bank *bank, int id)
 	}
 }
 
-static void __init omap_gpio_chip_init(struct gpio_bank *bank)
+static void __devinit omap_gpio_chip_init(struct gpio_bank *bank)
 {
 	int j;
 	static int gpio;
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 125f565..169e930 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -189,7 +189,7 @@  static struct dentry *pm_dbg_dir;
 
 static int pm_dbg_init_done;
 
-static int __init pm_dbg_init(void);
+static int pm_dbg_init(void);
 
 enum {
 	DEBUG_FILE_COUNTERS = 0,
@@ -595,7 +595,7 @@  static int option_set(void *data, u64 val)
 
 DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n");
 
-static int __init pm_dbg_init(void)
+static int pm_dbg_init(void)
 {
 	int i;
 	struct dentry *d;