Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1244705

[PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode
Date 2015-10-12 15:50 +0200
Message-ID <qiLEe-zW-21@gated-at.bofh.it> (permalink)
References <qiLEe-zW-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The z2 machine calls pxa27x_set_pwrmode() in order to power off
the machine, but this function gets discarded early at boot because
it is marked __init, as pointed out by kbuild:

WARNING: vmlinux.o(.text+0x145c4): Section mismatch in reference from the function z2_power_off() to the function .init.text:pxa27x_set_pwrmode()
The function z2_power_off() references
the function __init pxa27x_set_pwrmode().
This is often because z2_power_off lacks a __init
annotation or the annotation of pxa27x_set_pwrmode is wrong.

This removes the __init section modifier to fix rebooting and the
build error.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: ba4a90a6d86a ("ARM: pxa/z2: fix building error of pxa27x_cpu_suspend() no longer available")
---
This is a fix for an old bug, I'd just put it into 4.4

It showed up now because section mismatches now produce errors instead
of warnings.

diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 885d83cfa522..3d5335f2bbe0 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(pxa27x_configure_ac97reset);
  */
 static unsigned int pwrmode = PWRMODE_SLEEP;
 
-int __init pxa27x_set_pwrmode(unsigned int mode)
+int pxa27x_set_pwrmode(unsigned int mode)
 {
 	switch (mode) {
 	case PWRMODE_SLEEP:
diff --git a/arch/arm/mach-pxa/pxa27x.h b/arch/arm/mach-pxa/pxa27x.h
index d064e0a9f2ce..075131d83eab 100644
--- a/arch/arm/mach-pxa/pxa27x.h
+++ b/arch/arm/mach-pxa/pxa27x.h
@@ -19,7 +19,7 @@
 #define ARB_CORE_PARK		(1<<24)	   /* Be parked with core when idle */
 #define ARB_LOCK_FLAG		(1<<23)	   /* Only Locking masters gain access to the bus */
 
-extern int __init pxa27x_set_pwrmode(unsigned int mode);
+extern int pxa27x_set_pwrmode(unsigned int mode);
 extern void pxa27x_cpu_pm_enter(suspend_state_t state);
 
 #endif /* __MACH_PXA27x_H */

--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ARM: pxa: fix pxa3xx DFI lockup hack Arnd Bergmann <arnd@arndb.de> - 2015-10-12 15:50 +0200
  [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Arnd Bergmann <arnd@arndb.de> - 2015-10-12 15:50 +0200
    Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-12 19:20 +0200
      Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-12 21:00 +0200
        Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Arnd Bergmann <arnd@arndb.de> - 2015-10-12 21:30 +0200
          Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-12 23:20 +0200
            Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Arnd Bergmann <arnd@arndb.de> - 2015-10-13 10:00 +0200
      Re: [PATCH] pxa: remove incorrect __init annotation on pxa27x_set_pwrmode Arnd Bergmann <arnd@arndb.de> - 2015-10-12 21:00 +0200
  Re: [PATCH] ARM: pxa: fix pxa3xx DFI lockup hack Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-12 19:10 +0200
    Re: [PATCH] ARM: pxa: fix pxa3xx DFI lockup hack Arnd Bergmann <arnd@arndb.de> - 2015-10-12 21:00 +0200
    Re: [PATCH] ARM: pxa: fix pxa3xx DFI lockup hack Arnd Bergmann <arnd@arndb.de> - 2015-10-14 17:20 +0200
      Re: [PATCH] ARM: pxa: fix pxa3xx DFI lockup hack Robert Jarzmik <robert.jarzmik@free.fr> - 2015-10-14 21:20 +0200

csiph-web