linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch: *: remove '__init' for setup_profiling_timer()
@ 2013-10-23  2:05 Chen Gang
  2013-10-31  5:45 ` Vineet Gupta
  0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2013-10-23  2:05 UTC (permalink / raw)
  To: vgupta, Mike Frysinger, James E.J. Bottomley, Helge Deller,
	Arnd Bergmann, Thomas Gleixner, Paul Gortmaker, Srivatsa S. Bhat,
	realmz paranoid, James Bottomley
  Cc: linux-kernel, uclinux-dist-devel, Parisc List, Andrew Morton

Most of architectures not use '__init' for setup_profiling_timer(), so
need remove it, or can generate warning (e.g. arc with allmodconfig):

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


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 arch/arc/kernel/smp.c          |    2 +-
 arch/blackfin/mach-bf561/smp.c |    2 +-
 arch/parisc/kernel/smp.c       |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index bca3052..3bdac11 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -187,7 +187,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
 /*
  * not supported here
  */
-int __init setup_profiling_timer(unsigned int multiplier)
+int setup_profiling_timer(unsigned int multiplier)
 {
 	return -EINVAL;
 }
diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
index 11789be..3bef058 100644
--- a/arch/blackfin/mach-bf561/smp.c
+++ b/arch/blackfin/mach-bf561/smp.c
@@ -43,7 +43,7 @@ void __init platform_prepare_cpus(unsigned int max_cpus)
 	init_cpu_present(&mask);
 }
 
-int __init setup_profiling_timer(unsigned int multiplier) /* not supported */
+int setup_profiling_timer(unsigned int multiplier) /* not supported */
 {
 	return -EINVAL;
 }
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 8a252f2..2e8cd36 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -433,7 +433,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
 }
 
 #ifdef CONFIG_PROC_FS
-int __init
+int
 setup_profiling_timer(unsigned int multiplier)
 {
 	return -EINVAL;
-- 
1.7.7.6

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

* Re: [PATCH] arch: *: remove '__init' for setup_profiling_timer()
  2013-10-23  2:05 [PATCH] arch: *: remove '__init' for setup_profiling_timer() Chen Gang
@ 2013-10-31  5:45 ` Vineet Gupta
  2013-10-31  6:11   ` Chen Gang
  0 siblings, 1 reply; 6+ messages in thread
From: Vineet Gupta @ 2013-10-31  5:45 UTC (permalink / raw)
  To: Chen Gang, linux-arch, Mike Frysinger, James E.J. Bottomley,
	Helge Deller, Arnd Bergmann, Thomas Gleixner, Paul Gortmaker,
	Srivatsa S. Bhat, realmz paranoid, James Bottomley
  Cc: linux-kernel, uclinux-dist-devel, Parisc List, Andrew Morton

On 10/23/2013 07:36 AM, Chen Gang wrote:
> Most of architectures not use '__init' for setup_profiling_timer(), so
> need remove it, or can generate warning (e.g. arc with allmodconfig):
>
>     MODPOST vmlinux.o
>   WARNING: vmlinux.o(.text+0x3c682): Section mismatch in reference from the function write_profile() to the function .init.text:setup_profiling_timer()
>   The function write_profile() references
>   the function __init setup_profiling_timer().
>   This is often because write_profile lacks a __init
>   annotation or the annotation of setup_profiling_timer is wrong.
>
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/arc/kernel/smp.c          |    2 +-
>  arch/blackfin/mach-bf561/smp.c |    2 +-
>  arch/parisc/kernel/smp.c       |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
> index bca3052..3bdac11 100644
> --- a/arch/arc/kernel/smp.c
> +++ b/arch/arc/kernel/smp.c
> @@ -187,7 +187,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>  /*
>   * not supported here
>   */
> -int __init setup_profiling_timer(unsigned int multiplier)
> +int setup_profiling_timer(unsigned int multiplier)
>  {
>  	return -EINVAL;
>  }
> diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
> index 11789be..3bef058 100644
> --- a/arch/blackfin/mach-bf561/smp.c
> +++ b/arch/blackfin/mach-bf561/smp.c
> @@ -43,7 +43,7 @@ void __init platform_prepare_cpus(unsigned int max_cpus)
>  	init_cpu_present(&mask);
>  }
>  
> -int __init setup_profiling_timer(unsigned int multiplier) /* not supported */
> +int setup_profiling_timer(unsigned int multiplier) /* not supported */
>  {
>  	return -EINVAL;
>  }
> diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
> index 8a252f2..2e8cd36 100644
> --- a/arch/parisc/kernel/smp.c
> +++ b/arch/parisc/kernel/smp.c
> @@ -433,7 +433,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
>  }
>  
>  #ifdef CONFIG_PROC_FS
> -int __init
> +int
>  setup_profiling_timer(unsigned int multiplier)
>  {
>  	return -EINVAL;

In theory this change is OK. However this is legacy code at best and it would be
better to define a weak definition in kernel/profile.c and remove this cruft from
relevant arches. I'll send out a patch.

-Vineet

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

* Re: [PATCH] arch: *: remove '__init' for setup_profiling_timer()
  2013-10-31  5:45 ` Vineet Gupta
@ 2013-10-31  6:11   ` Chen Gang
  2013-10-31  6:14     ` Chen Gang
  0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2013-10-31  6:11 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: linux-arch, Mike Frysinger, James E.J. Bottomley, Helge Deller,
	Arnd Bergmann, Thomas Gleixner, Paul Gortmaker, Srivatsa S. Bhat,
	realmz paranoid, James Bottomley, linux-kernel,
	uclinux-dist-devel, Parisc List, Andrew Morton

On 10/31/2013 01:45 PM, Vineet Gupta wrote:
> On 10/23/2013 07:36 AM, Chen Gang wrote:
>> Most of architectures not use '__init' for setup_profiling_timer(), so
>> need remove it, or can generate warning (e.g. arc with allmodconfig):
>>
>>     MODPOST vmlinux.o
>>   WARNING: vmlinux.o(.text+0x3c682): Section mismatch in reference from the function write_profile() to the function .init.text:setup_profiling_timer()
>>   The function write_profile() references
>>   the function __init setup_profiling_timer().
>>   This is often because write_profile lacks a __init
>>   annotation or the annotation of setup_profiling_timer is wrong.
>>
>>
>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> ---
>>  arch/arc/kernel/smp.c          |    2 +-
>>  arch/blackfin/mach-bf561/smp.c |    2 +-
>>  arch/parisc/kernel/smp.c       |    2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
>> index bca3052..3bdac11 100644
>> --- a/arch/arc/kernel/smp.c
>> +++ b/arch/arc/kernel/smp.c
>> @@ -187,7 +187,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>>  /*
>>   * not supported here
>>   */
>> -int __init setup_profiling_timer(unsigned int multiplier)
>> +int setup_profiling_timer(unsigned int multiplier)
>>  {
>>  	return -EINVAL;
>>  }
>> diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
>> index 11789be..3bef058 100644
>> --- a/arch/blackfin/mach-bf561/smp.c
>> +++ b/arch/blackfin/mach-bf561/smp.c
>> @@ -43,7 +43,7 @@ void __init platform_prepare_cpus(unsigned int max_cpus)
>>  	init_cpu_present(&mask);
>>  }
>>  
>> -int __init setup_profiling_timer(unsigned int multiplier) /* not supported */
>> +int setup_profiling_timer(unsigned int multiplier) /* not supported */
>>  {
>>  	return -EINVAL;
>>  }
>> diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
>> index 8a252f2..2e8cd36 100644
>> --- a/arch/parisc/kernel/smp.c
>> +++ b/arch/parisc/kernel/smp.c
>> @@ -433,7 +433,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
>>  }
>>  
>>  #ifdef CONFIG_PROC_FS
>> -int __init
>> +int
>>  setup_profiling_timer(unsigned int multiplier)
>>  {
>>  	return -EINVAL;
> 
> In theory this change is OK. However this is legacy code at best and it would be
> better to define a weak definition in kernel/profile.c and remove this cruft from
> relevant arches. I'll send out a patch.
> 

That sounds good to me.

> -Vineet
> 
> 


-- 
Chen Gang

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

* Re: [PATCH] arch: *: remove '__init' for setup_profiling_timer()
  2013-10-31  6:11   ` Chen Gang
@ 2013-10-31  6:14     ` Chen Gang
  2013-10-31  6:22       ` Vineet Gupta
  0 siblings, 1 reply; 6+ messages in thread
From: Chen Gang @ 2013-10-31  6:14 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: linux-arch, Mike Frysinger, James E.J. Bottomley, Helge Deller,
	Arnd Bergmann, Thomas Gleixner, Paul Gortmaker, Srivatsa S. Bhat,
	realmz paranoid, James Bottomley, linux-kernel,
	uclinux-dist-devel, Parisc List, Andrew Morton

On 10/31/2013 02:11 PM, Chen Gang wrote:
> On 10/31/2013 01:45 PM, Vineet Gupta wrote:
>> On 10/23/2013 07:36 AM, Chen Gang wrote:
>>> Most of architectures not use '__init' for setup_profiling_timer(), so
>>> need remove it, or can generate warning (e.g. arc with allmodconfig):
>>>
>>>     MODPOST vmlinux.o
>>>   WARNING: vmlinux.o(.text+0x3c682): Section mismatch in reference from the function write_profile() to the function .init.text:setup_profiling_timer()
>>>   The function write_profile() references
>>>   the function __init setup_profiling_timer().
>>>   This is often because write_profile lacks a __init
>>>   annotation or the annotation of setup_profiling_timer is wrong.
>>>
>>>
>>> Signed-off-by: Chen Gang <gang.chen@asianux.com>
>>> ---
>>>  arch/arc/kernel/smp.c          |    2 +-
>>>  arch/blackfin/mach-bf561/smp.c |    2 +-
>>>  arch/parisc/kernel/smp.c       |    2 +-
>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
>>> index bca3052..3bdac11 100644
>>> --- a/arch/arc/kernel/smp.c
>>> +++ b/arch/arc/kernel/smp.c
>>> @@ -187,7 +187,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)
>>>  /*
>>>   * not supported here
>>>   */
>>> -int __init setup_profiling_timer(unsigned int multiplier)
>>> +int setup_profiling_timer(unsigned int multiplier)
>>>  {
>>>  	return -EINVAL;
>>>  }
>>> diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
>>> index 11789be..3bef058 100644
>>> --- a/arch/blackfin/mach-bf561/smp.c
>>> +++ b/arch/blackfin/mach-bf561/smp.c
>>> @@ -43,7 +43,7 @@ void __init platform_prepare_cpus(unsigned int max_cpus)
>>>  	init_cpu_present(&mask);
>>>  }
>>>  
>>> -int __init setup_profiling_timer(unsigned int multiplier) /* not supported */
>>> +int setup_profiling_timer(unsigned int multiplier) /* not supported */
>>>  {
>>>  	return -EINVAL;
>>>  }
>>> diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
>>> index 8a252f2..2e8cd36 100644
>>> --- a/arch/parisc/kernel/smp.c
>>> +++ b/arch/parisc/kernel/smp.c
>>> @@ -433,7 +433,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
>>>  }
>>>  
>>>  #ifdef CONFIG_PROC_FS
>>> -int __init
>>> +int
>>>  setup_profiling_timer(unsigned int multiplier)
>>>  {
>>>  	return -EINVAL;
>>
>> In theory this change is OK. However this is legacy code at best and it would be
>> better to define a weak definition in kernel/profile.c and remove this cruft from
>> relevant arches. I'll send out a patch.
>>
> 
> That sounds good to me.
> 

Hmm... if so, recommend to modify another architectures which also only
return "-EINVAL", but without "__init" prefix.


Thanks.
-- 
Chen Gang

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

* Re: [PATCH] arch: *: remove '__init' for setup_profiling_timer()
  2013-10-31  6:14     ` Chen Gang
@ 2013-10-31  6:22       ` Vineet Gupta
  2013-10-31  6:36         ` Chen Gang
  0 siblings, 1 reply; 6+ messages in thread
From: Vineet Gupta @ 2013-10-31  6:22 UTC (permalink / raw)
  To: Chen Gang
  Cc: linux-arch, Mike Frysinger, James E.J. Bottomley, Helge Deller,
	Arnd Bergmann, Thomas Gleixner, Paul Gortmaker, Srivatsa S. Bhat,
	realmz paranoid, James Bottomley, linux-kernel,
	uclinux-dist-devel, Parisc List, Andrew Morton

On 10/31/2013 11:45 AM, Chen Gang wrote:
> Hmm... if so, recommend to modify another architectures which also only
> return "-EINVAL", but without "__init" prefix.

Yes in first pass, it will only convert the arches which return EINVAL but can ask
the maintainers whether they want the alternate versions too.

So you want to take a stab at this series.

-Vineet

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

* Re: [PATCH] arch: *: remove '__init' for setup_profiling_timer()
  2013-10-31  6:22       ` Vineet Gupta
@ 2013-10-31  6:36         ` Chen Gang
  0 siblings, 0 replies; 6+ messages in thread
From: Chen Gang @ 2013-10-31  6:36 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: linux-arch, Mike Frysinger, James E.J. Bottomley, Helge Deller,
	Arnd Bergmann, Thomas Gleixner, Paul Gortmaker, Srivatsa S. Bhat,
	realmz paranoid, James Bottomley, linux-kernel,
	uclinux-dist-devel, Parisc List, Andrew Morton

On 10/31/2013 02:22 PM, Vineet Gupta wrote:
> On 10/31/2013 11:45 AM, Chen Gang wrote:
>> > Hmm... if so, recommend to modify another architectures which also only
>> > return "-EINVAL", but without "__init" prefix.
> Yes in first pass, it will only convert the arches which return EINVAL but can ask
> the maintainers whether they want the alternate versions too.
> 

Yes.

> So you want to take a stab at this series.

If you have time, please help send.

In 1st half of next month, I will/should turn back to do another things
(e.g. use test tools and read code to find issues, and try to solve them).


Thanks.
-- 
Chen Gang

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

end of thread, other threads:[~2013-10-31  6:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23  2:05 [PATCH] arch: *: remove '__init' for setup_profiling_timer() Chen Gang
2013-10-31  5:45 ` Vineet Gupta
2013-10-31  6:11   ` Chen Gang
2013-10-31  6:14     ` Chen Gang
2013-10-31  6:22       ` Vineet Gupta
2013-10-31  6:36         ` Chen Gang

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).