Skip to contentSkip to conversation

arch: *: remove '__init' for setup_profiling_timer()

PATCH In review Chen Gang 2 participants 6 messages Oct 23, 2013 – Oct 31, 2013

Subsystems (3)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch: *: remove '__init' for setup_profiling_timer()

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.

---
 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(-)
arch/arc/kernel/smp.c +1 -1
index bca3052..3bdac11 100644
@@ -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;
 }
arch/blackfin/mach-bf561/smp.c +1 -1
index 11789be..3bef058 100644
@@ -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;
 }
arch/parisc/kernel/smp.c +1 -1
index 8a252f2..2e8cd36 100644
@@ -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;
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 49 lines · Chen Gang

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.

---
 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(-)
arch/arc/kernel/smp.c +1 -1
index bca3052..3bdac11 100644
@@ -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;
 }
arch/blackfin/mach-bf561/smp.c +1 -1
index 11789be..3bef058 100644
@@ -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;
 }
arch/parisc/kernel/smp.c +0 -0
index 8a252f2..2e8cd36 100644

arch/parisc/kernel/smp.c int __cpu_up(unsigned int cpu, struct task_struct *tidle) · line 439

Quoted 8 lines
arch/parisc/kernel/smp.c +1 -1
@@ -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

author
#2 lore raw
Quoted 52 lines · Vineet Gupta
Quoted 51 lines · Chen Gang

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.

---
 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(-)
arch/arc/kernel/smp.c +1 -1
index bca3052..3bdac11 100644
@@ -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;
 }
arch/blackfin/mach-bf561/smp.c +1 -1
index 11789be..3bef058 100644
@@ -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;
 }
arch/parisc/kernel/smp.c +0 -0
index 8a252f2..2e8cd36 100644
@@ -433,7 +433,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
 }
 
Quoted 11 lines

arch/parisc/kernel/smp.c int __cpu_up(unsigned int cpu, struct task_struct *tidle) · line 439

Quoted 6 lines
arch/parisc/kernel/smp.c +1 -1
 #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.

Quoted 3 lines

-Vineet

Signature · 1 line
Chen Gang
author
#3 lore raw
Quoted 65 lines · Chen Gang
Quoted 52 lines · Vineet Gupta
Quoted 51 lines · Chen Gang

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.

---
 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(-)
arch/arc/kernel/smp.c +1 -1
index bca3052..3bdac11 100644
@@ -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;
 }
arch/blackfin/mach-bf561/smp.c +1 -1
index 11789be..3bef058 100644
@@ -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;
 }
arch/parisc/kernel/smp.c +0 -0
index 8a252f2..2e8cd36 100644
@@ -433,7 +433,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
 }
 
Quoted 11 lines

arch/parisc/kernel/smp.c int __cpu_up(unsigned int cpu, struct task_struct *tidle) · line 439

Quoted 6 lines
arch/parisc/kernel/smp.c +1 -1
 #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.

Quoted 2 lines

That sounds good to me.

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

Thanks.

Signature · 1 line
Chen Gang
#4 lore raw
Quoted 2 lines · Chen Gang

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

author
#5 lore raw
Quoted 6 lines · Vineet Gupta
Quoted 2 lines · Chen Gang
Quoted 2 lines

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.

Quoted 1 line

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.

Signature · 1 line
Chen Gang