linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/2] ARM: S3C2410: Remove section mismatch warning
@ 2011-10-07 11:55 Tushar Behera
  2011-10-07 11:55 ` [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init() Tushar Behera
  2011-10-07 11:55 ` [PATCH V2 2/2] ARM: S3C2410: irq: Remove __init attributes to fix compilation warning Tushar Behera
  0 siblings, 2 replies; 5+ messages in thread
From: Tushar Behera @ 2011-10-07 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

While compiling with s3c2410_defconfig, we receive 4 section mismatch
warnings.

Patch 1 addresses a couple of warnings related to usb_simtec_init().
Patch 2 addresses mismatch warnings in a couple of mach-*/irq.c files.

Changes for V2:
	* The original patch is splitted to address to different logical
	solutions.
	* __initdata attribute is removed from struct sysdev_driver
	structures and __init attribute is removed from all referenced
	function definitions.

The patches are rebased on v3.1-rc8. They are only build tested,
they are not boot tested on any hardware.


Tushar Behera (2):
  ARM: S3C2410: Add __init attribute to usb_simtec_init()
  ARM: S3C2410: irq: Remove __init attributes to fix compilation
    warning

 arch/arm/mach-s3c2410/usb-simtec.c |    2 +-
 arch/arm/mach-s3c2410/usb-simtec.h |    2 +-
 arch/arm/mach-s3c2416/irq.c        |    4 ++--
 arch/arm/mach-s3c2443/irq.c        |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init()
  2011-10-07 11:55 [PATCH V2 0/2] ARM: S3C2410: Remove section mismatch warning Tushar Behera
@ 2011-10-07 11:55 ` Tushar Behera
  2011-10-08 14:18   ` Sergei Shtylyov
  2011-10-07 11:55 ` [PATCH V2 2/2] ARM: S3C2410: irq: Remove __init attributes to fix compilation warning Tushar Behera
  1 sibling, 1 reply; 5+ messages in thread
From: Tushar Behera @ 2011-10-07 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

usb_simtec_init() references s3c_ohci_set_platdata() which is defined
with __init attribute. Hence to remove section mismatch warning, __init
attribute is added to usb_simtec_init().

It removes following two warnigs.

WARNING: vmlinux.o(.text+0x1460c): Section mismatch in reference from
the function     usb_simtec_init() to the function
 .init.text:s3c_ohci_set_platdata()
The function usb_simtec_init() references the function
 __init s3c_ohci_set_platdata().

WARNING: vmlinux.o(.text+0x14650): Section mismatch in reference from
the function     usb_simtec_init() to the (unknown reference)
.init.data:(unknown)
The function usb_simtec_init() references the (unknown reference)
__initdata (unknown).

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 arch/arm/mach-s3c2410/usb-simtec.c |    2 +-
 arch/arm/mach-s3c2410/usb-simtec.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 29bd3d9..3a1028c 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -104,7 +104,7 @@ static struct s3c2410_hcd_info usb_simtec_info __initdata = {
 };
 
 
-int usb_simtec_init(void)
+int __init usb_simtec_init(void)
 {
 	int ret;
 
diff --git a/arch/arm/mach-s3c2410/usb-simtec.h b/arch/arm/mach-s3c2410/usb-simtec.h
index 03842ed..43cc88f 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.h
+++ b/arch/arm/mach-s3c2410/usb-simtec.h
@@ -12,5 +12,5 @@
  * published by the Free Software Foundation.
 */
 
-extern int usb_simtec_init(void);
+extern int __init usb_simtec_init(void);
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH V2 2/2] ARM: S3C2410: irq: Remove __init attributes to fix compilation warning
  2011-10-07 11:55 [PATCH V2 0/2] ARM: S3C2410: Remove section mismatch warning Tushar Behera
  2011-10-07 11:55 ` [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init() Tushar Behera
@ 2011-10-07 11:55 ` Tushar Behera
  1 sibling, 0 replies; 5+ messages in thread
From: Tushar Behera @ 2011-10-07 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

The structure *_irq_driver is passed as a parameter in
sysdev_driver_register(). This in turn would add this structure to a
list which may be traversed later.

Hence, even though the functions referenced through this structure have
__init attribute, we cannot possibly add __initdata attribute to it.

To remove compilation warnings, the functions referenced thorugh this
structure are also defined without __init attribute.

It removes following two warnings.

WARNING: vmlinux.o(.data+0x4f58): Section mismatch in reference from the
variable s3c2416_irq_driver to the function .init.text:s3c2416_irq_add()
The variable s3c2416_irq_driver references the function __init s3c2416_irq_add()

WARNING: vmlinux.o(.data+0x7c50): Section mismatch in reference from the
variable s3c2443_irq_driver to the function .init.text:s3c2443_irq_add()
The variable s3c2443_irq_driver references the function __init s3c2443_irq_add()

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 arch/arm/mach-s3c2416/irq.c |    4 ++--
 arch/arm/mach-s3c2443/irq.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 28ad20d..53e8e57 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -194,7 +194,7 @@ static struct irq_chip s3c2416_irq_uart3 = {
 
 /* IRQ initialisation code */
 
-static int __init s3c2416_add_sub(unsigned int base,
+static int s3c2416_add_sub(unsigned int base,
 				   void (*demux)(unsigned int,
 						 struct irq_desc *),
 				   struct irq_chip *chip,
@@ -213,7 +213,7 @@ static int __init s3c2416_add_sub(unsigned int base,
 	return 0;
 }
 
-static int __init s3c2416_irq_add(struct sys_device *sysdev)
+static int s3c2416_irq_add(struct sys_device *sysdev)
 {
 	printk(KERN_INFO "S3C2416: IRQ Support\n");
 
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c2443/irq.c
index 83ecb11..18585dd 100644
--- a/arch/arm/mach-s3c2443/irq.c
+++ b/arch/arm/mach-s3c2443/irq.c
@@ -222,7 +222,7 @@ static struct irq_chip s3c2443_irq_cam = {
 
 /* IRQ initialisation code */
 
-static int __init s3c2443_add_sub(unsigned int base,
+static int s3c2443_add_sub(unsigned int base,
 				   void (*demux)(unsigned int,
 						 struct irq_desc *),
 				   struct irq_chip *chip,
@@ -241,7 +241,7 @@ static int __init s3c2443_add_sub(unsigned int base,
 	return 0;
 }
 
-static int __init s3c2443_irq_add(struct sys_device *sysdev)
+static int s3c2443_irq_add(struct sys_device *sysdev)
 {
 	printk("S3C2443: IRQ Support\n");
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init()
  2011-10-07 11:55 ` [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init() Tushar Behera
@ 2011-10-08 14:18   ` Sergei Shtylyov
  2011-10-10  4:09     ` Tushar Behera
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2011-10-08 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 07-10-2011 15:55, Tushar Behera wrote:

> usb_simtec_init() references s3c_ohci_set_platdata() which is defined
> with __init attribute. Hence to remove section mismatch warning, __init
> attribute is added to usb_simtec_init().

> It removes following two warnigs.

> WARNING: vmlinux.o(.text+0x1460c): Section mismatch in reference from
> the function     usb_simtec_init() to the function
>   .init.text:s3c_ohci_set_platdata()
> The function usb_simtec_init() references the function
>   __init s3c_ohci_set_platdata().

> WARNING: vmlinux.o(.text+0x14650): Section mismatch in reference from
> the function     usb_simtec_init() to the (unknown reference)
> .init.data:(unknown)
> The function usb_simtec_init() references the (unknown reference)
> __initdata (unknown).

> Signed-off-by: Tushar Behera<tushar.behera@linaro.org>
[...]

> diff --git a/arch/arm/mach-s3c2410/usb-simtec.h b/arch/arm/mach-s3c2410/usb-simtec.h
> index 03842ed..43cc88f 100644
> --- a/arch/arm/mach-s3c2410/usb-simtec.h
> +++ b/arch/arm/mach-s3c2410/usb-simtec.h
> @@ -12,5 +12,5 @@
>    * published by the Free Software Foundation.
>   */
>
> -extern int usb_simtec_init(void);
> +extern int __init usb_simtec_init(void);

    Function prototypes don't need to be annotated with __init.

WBR, Sergei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init()
  2011-10-08 14:18   ` Sergei Shtylyov
@ 2011-10-10  4:09     ` Tushar Behera
  0 siblings, 0 replies; 5+ messages in thread
From: Tushar Behera @ 2011-10-10  4:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sergei,

On Saturday 08 October 2011 07:48 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 07-10-2011 15:55, Tushar Behera wrote:
>
>> usb_simtec_init() references s3c_ohci_set_platdata() which is defined
>> with __init attribute. Hence to remove section mismatch warning, __init
>> attribute is added to usb_simtec_init().
>
>> It removes following two warnigs.
>
>> WARNING: vmlinux.o(.text+0x1460c): Section mismatch in reference from
>> the function usb_simtec_init() to the function
>> .init.text:s3c_ohci_set_platdata()
>> The function usb_simtec_init() references the function
>> __init s3c_ohci_set_platdata().
>
>> WARNING: vmlinux.o(.text+0x14650): Section mismatch in reference from
>> the function usb_simtec_init() to the (unknown reference)
>> .init.data:(unknown)
>> The function usb_simtec_init() references the (unknown reference)
>> __initdata (unknown).
>
>> Signed-off-by: Tushar Behera<tushar.behera@linaro.org>
> [...]
>
>> diff --git a/arch/arm/mach-s3c2410/usb-simtec.h
>> b/arch/arm/mach-s3c2410/usb-simtec.h
>> index 03842ed..43cc88f 100644
>> --- a/arch/arm/mach-s3c2410/usb-simtec.h
>> +++ b/arch/arm/mach-s3c2410/usb-simtec.h
>> @@ -12,5 +12,5 @@
>> * published by the Free Software Foundation.
>> */
>>
>> -extern int usb_simtec_init(void);
>> +extern int __init usb_simtec_init(void);
>
> Function prototypes don't need to be annotated with __init.
>

I agree that function prototypes don't require to be annotated.

But, will it not be better to have same annotation for both function 
prototypes and the function definitions?

> WBR, Sergei
>

Thanks for your review.
-- 
Tushar Behera

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-10  4:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07 11:55 [PATCH V2 0/2] ARM: S3C2410: Remove section mismatch warning Tushar Behera
2011-10-07 11:55 ` [PATCH V2 1/2] ARM: S3C2410: Add __init attribute to usb_simtec_init() Tushar Behera
2011-10-08 14:18   ` Sergei Shtylyov
2011-10-10  4:09     ` Tushar Behera
2011-10-07 11:55 ` [PATCH V2 2/2] ARM: S3C2410: irq: Remove __init attributes to fix compilation warning Tushar Behera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).