All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: S3C24XX: Fix Section mismatch
@ 2012-03-07 10:36 ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-03-07 10:36 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc; +Cc: Kukjin Kim

Fixes following:

WARNING: arch/arm/mach-s3c24xx/built-in.o(.text+0x4464): 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).
This is often because usb_simtec_init lacks a __initdata
annotation or the annotation of (unknown) is wrong.

WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference
from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add()
The variable s3c2416_irq_interface references
the function __init s3c2416_irq_add()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference
from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add()
The variable s3c2443_irq_interface references
the function __init s3c2443_irq_add()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s3c24xx/irq-s3c2416.c |    2 +-
 arch/arm/mach-s3c24xx/irq-s3c2443.c |    2 +-
 arch/arm/mach-s3c24xx/simtec-usb.c  |    2 +-
 arch/arm/mach-s3c24xx/simtec.h      |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
index b8a5836..59b7632 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
@@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)
 	return 0;
 }
 
-static struct subsys_interface s3c2416_irq_interface = {
+static struct subsys_interface s3c2416_irq_interface __initdata = {
 	.name		= "s3c2416_irq",
 	.subsys		= &s3c2416_subsys,
 	.add_dev	= s3c2416_irq_add,
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
index 35e4ff2..439f186 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
@@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)
 	return 0;
 }
 
-static struct subsys_interface s3c2443_irq_interface = {
+static struct subsys_interface s3c2443_irq_interface __initdata = {
 	.name		= "s3c2443_irq",
 	.subsys		= &s3c2443_subsys,
 	.add_dev	= s3c2443_irq_add,
diff --git a/arch/arm/mach-s3c24xx/simtec-usb.c b/arch/arm/mach-s3c24xx/simtec-usb.c
index d91c1a7..c303d1b 100644
--- a/arch/arm/mach-s3c24xx/simtec-usb.c
+++ b/arch/arm/mach-s3c24xx/simtec-usb.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-s3c24xx/simtec.h b/arch/arm/mach-s3c24xx/simtec.h
index ae8f4f9..f514cd5 100644
--- a/arch/arm/mach-s3c24xx/simtec.h
+++ b/arch/arm/mach-s3c24xx/simtec.h
@@ -15,7 +15,7 @@ struct s3c24xx_audio_simtec_pdata;
 
 extern void nor_simtec_init(void);
 
-extern int usb_simtec_init(void);
+extern int __init usb_simtec_init(void);
 
 extern int simtec_audio_add(const char *codec_name, bool has_lr_routing,
 			    struct s3c24xx_audio_simtec_pdata *pdata);
-- 
1.7.4.4

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

* [PATCH] ARM: S3C24XX: Fix Section mismatch
@ 2012-03-07 10:36 ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-03-07 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Fixes following:

WARNING: arch/arm/mach-s3c24xx/built-in.o(.text+0x4464): 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).
This is often because usb_simtec_init lacks a __initdata
annotation or the annotation of (unknown) is wrong.

WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference
from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add()
The variable s3c2416_irq_interface references
the function __init s3c2416_irq_add()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference
from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add()
The variable s3c2443_irq_interface references
the function __init s3c2443_irq_add()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s3c24xx/irq-s3c2416.c |    2 +-
 arch/arm/mach-s3c24xx/irq-s3c2443.c |    2 +-
 arch/arm/mach-s3c24xx/simtec-usb.c  |    2 +-
 arch/arm/mach-s3c24xx/simtec.h      |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
index b8a5836..59b7632 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
@@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)
 	return 0;
 }
 
-static struct subsys_interface s3c2416_irq_interface = {
+static struct subsys_interface s3c2416_irq_interface __initdata = {
 	.name		= "s3c2416_irq",
 	.subsys		= &s3c2416_subsys,
 	.add_dev	= s3c2416_irq_add,
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
index 35e4ff2..439f186 100644
--- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
@@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)
 	return 0;
 }
 
-static struct subsys_interface s3c2443_irq_interface = {
+static struct subsys_interface s3c2443_irq_interface __initdata = {
 	.name		= "s3c2443_irq",
 	.subsys		= &s3c2443_subsys,
 	.add_dev	= s3c2443_irq_add,
diff --git a/arch/arm/mach-s3c24xx/simtec-usb.c b/arch/arm/mach-s3c24xx/simtec-usb.c
index d91c1a7..c303d1b 100644
--- a/arch/arm/mach-s3c24xx/simtec-usb.c
+++ b/arch/arm/mach-s3c24xx/simtec-usb.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-s3c24xx/simtec.h b/arch/arm/mach-s3c24xx/simtec.h
index ae8f4f9..f514cd5 100644
--- a/arch/arm/mach-s3c24xx/simtec.h
+++ b/arch/arm/mach-s3c24xx/simtec.h
@@ -15,7 +15,7 @@ struct s3c24xx_audio_simtec_pdata;
 
 extern void nor_simtec_init(void);
 
-extern int usb_simtec_init(void);
+extern int __init usb_simtec_init(void);
 
 extern int simtec_audio_add(const char *codec_name, bool has_lr_routing,
 			    struct s3c24xx_audio_simtec_pdata *pdata);
-- 
1.7.4.4

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

* Re: [PATCH] ARM: S3C24XX: Fix Section mismatch
  2012-03-07 10:36 ` Kukjin Kim
@ 2012-03-07 11:22   ` Russell King - ARM Linux
  -1 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-03-07 11:22 UTC (permalink / raw)
  To: Kukjin Kim; +Cc: linux-arm-kernel, linux-samsung-soc

On Wed, Mar 07, 2012 at 02:36:52AM -0800, Kukjin Kim wrote:
> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference
> from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add()
> The variable s3c2416_irq_interface references
> the function __init s3c2416_irq_add()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference
> from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add()
> The variable s3c2443_irq_interface references
> the function __init s3c2443_irq_add()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
> index b8a5836..59b7632 100644
> --- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
> +++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
> @@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)
>  	return 0;
>  }
>  
> -static struct subsys_interface s3c2416_irq_interface = {
> +static struct subsys_interface s3c2416_irq_interface __initdata = {
>  	.name		= "s3c2416_irq",
>  	.subsys		= &s3c2416_subsys,
>  	.add_dev	= s3c2416_irq_add,
> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
> index 35e4ff2..439f186 100644
> --- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
> +++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
> @@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)
>  	return 0;
>  }
>  
> -static struct subsys_interface s3c2443_irq_interface = {
> +static struct subsys_interface s3c2443_irq_interface __initdata = {
>  	.name		= "s3c2443_irq",
>  	.subsys		= &s3c2443_subsys,
>  	.add_dev	= s3c2443_irq_add,

You register these structures with some other bit of code.  That other
bit of code adds these structures to a list. You then mark them as
__initdata, which means they get freed and the memory reused.  That
corrupts the list beneath the other code.

So, clearly, both of these are wrong.

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

* [PATCH] ARM: S3C24XX: Fix Section mismatch
@ 2012-03-07 11:22   ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2012-03-07 11:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 02:36:52AM -0800, Kukjin Kim wrote:
> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference
> from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add()
> The variable s3c2416_irq_interface references
> the function __init s3c2416_irq_add()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
> 
> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference
> from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add()
> The variable s3c2443_irq_interface references
> the function __init s3c2443_irq_add()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
> index b8a5836..59b7632 100644
> --- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
> +++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
> @@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)
>  	return 0;
>  }
>  
> -static struct subsys_interface s3c2416_irq_interface = {
> +static struct subsys_interface s3c2416_irq_interface __initdata = {
>  	.name		= "s3c2416_irq",
>  	.subsys		= &s3c2416_subsys,
>  	.add_dev	= s3c2416_irq_add,
> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
> index 35e4ff2..439f186 100644
> --- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
> +++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
> @@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)
>  	return 0;
>  }
>  
> -static struct subsys_interface s3c2443_irq_interface = {
> +static struct subsys_interface s3c2443_irq_interface __initdata = {
>  	.name		= "s3c2443_irq",
>  	.subsys		= &s3c2443_subsys,
>  	.add_dev	= s3c2443_irq_add,

You register these structures with some other bit of code.  That other
bit of code adds these structures to a list. You then mark them as
__initdata, which means they get freed and the memory reused.  That
corrupts the list beneath the other code.

So, clearly, both of these are wrong.

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

* Re: [PATCH] ARM: S3C24XX: Fix Section mismatch
  2012-03-07 11:22   ` Russell King - ARM Linux
@ 2012-03-07 11:41     ` Kukjin Kim
  -1 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-03-07 11:41 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: Kukjin Kim, linux-arm-kernel, linux-samsung-soc

On 03/07/12 03:22, Russell King - ARM Linux wrote:
> On Wed, Mar 07, 2012 at 02:36:52AM -0800, Kukjin Kim wrote:
>> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference
>> from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add()
>> The variable s3c2416_irq_interface references
>> the function __init s3c2416_irq_add()
>> If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the variable:
>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>>
>> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference
>> from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add()
>> The variable s3c2443_irq_interface references
>> the function __init s3c2443_irq_add()
>> If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the variable:
>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
>> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
>> index b8a5836..59b7632 100644
>> --- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
>> +++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
>> @@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)
>>   	return 0;
>>   }
>>
>> -static struct subsys_interface s3c2416_irq_interface = {
>> +static struct subsys_interface s3c2416_irq_interface __initdata = {
>>   	.name		= "s3c2416_irq",
>>   	.subsys		=&s3c2416_subsys,
>>   	.add_dev	= s3c2416_irq_add,
>> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
>> index 35e4ff2..439f186 100644
>> --- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
>> +++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
>> @@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)
>>   	return 0;
>>   }
>>
>> -static struct subsys_interface s3c2443_irq_interface = {
>> +static struct subsys_interface s3c2443_irq_interface __initdata = {
>>   	.name		= "s3c2443_irq",
>>   	.subsys		=&s3c2443_subsys,
>>   	.add_dev	= s3c2443_irq_add,
>
> You register these structures with some other bit of code.  That other
> bit of code adds these structures to a list. You then mark them as
> __initdata, which means they get freed and the memory reused.  That
> corrupts the list beneath the other code.
>
> So, clearly, both of these are wrong.

Oops, I see. Let me check it again.
Thanks for pointing out.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

* [PATCH] ARM: S3C24XX: Fix Section mismatch
@ 2012-03-07 11:41     ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2012-03-07 11:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/07/12 03:22, Russell King - ARM Linux wrote:
> On Wed, Mar 07, 2012 at 02:36:52AM -0800, Kukjin Kim wrote:
>> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0xf44): Section mismatch in reference
>> from the variable s3c2416_irq_interface to the function .init.text:s3c2416_irq_add()
>> The variable s3c2416_irq_interface references
>> the function __init s3c2416_irq_add()
>> If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the variable:
>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>>
>> WARNING: arch/arm/mach-s3c24xx/built-in.o(.data+0x1b80): Section mismatch in reference
>> from the variable s3c2443_irq_interface to the function .init.text:s3c2443_irq_add()
>> The variable s3c2443_irq_interface references
>> the function __init s3c2443_irq_add()
>> If the reference is valid then annotate the
>> variable with __init* or __refdata (see linux/init.h) or name the variable:
>> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
>> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
>> index b8a5836..59b7632 100644
>> --- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
>> +++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
>> @@ -310,7 +310,7 @@ static int __init s3c2416_irq_add(struct device *dev)
>>   	return 0;
>>   }
>>
>> -static struct subsys_interface s3c2416_irq_interface = {
>> +static struct subsys_interface s3c2416_irq_interface __initdata = {
>>   	.name		= "s3c2416_irq",
>>   	.subsys		=&s3c2416_subsys,
>>   	.add_dev	= s3c2416_irq_add,
>> diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
>> index 35e4ff2..439f186 100644
>> --- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
>> +++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
>> @@ -265,7 +265,7 @@ static int __init s3c2443_irq_add(struct device *dev)
>>   	return 0;
>>   }
>>
>> -static struct subsys_interface s3c2443_irq_interface = {
>> +static struct subsys_interface s3c2443_irq_interface __initdata = {
>>   	.name		= "s3c2443_irq",
>>   	.subsys		=&s3c2443_subsys,
>>   	.add_dev	= s3c2443_irq_add,
>
> You register these structures with some other bit of code.  That other
> bit of code adds these structures to a list. You then mark them as
> __initdata, which means they get freed and the memory reused.  That
> corrupts the list beneath the other code.
>
> So, clearly, both of these are wrong.

Oops, I see. Let me check it again.
Thanks for pointing out.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

end of thread, other threads:[~2012-03-07 11:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-07 10:36 [PATCH] ARM: S3C24XX: Fix Section mismatch Kukjin Kim
2012-03-07 10:36 ` Kukjin Kim
2012-03-07 11:22 ` Russell King - ARM Linux
2012-03-07 11:22   ` Russell King - ARM Linux
2012-03-07 11:41   ` Kukjin Kim
2012-03-07 11:41     ` Kukjin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.