aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-02-06 04:37:51 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:08 -0500
commit6c81c32f9616fd6f2795dceae2f70943cb4d8609 (patch)
treefcafa4b8b071fc9d3a8ea87fd7a1fefca965a5a4
parenteb38a996ebacefe4ce2274de901138505d9cc96b (diff)
calibrate_delay() must be __cpuinit
calibrate_delay() must be __cpuinit, not __{dev,}init. I've verified that this is correct for all users. While doing the latter, I also did the following cleanups: - remove pointless additional prototypes in C files - ensure all users #include <linux/delay.h> This fixes the following section mismatches with CONFIG_HOTPLUG=n, CONFIG_HOTPLUG_CPU=y: WARNING: vmlinux.o(.text+0x1128d): Section mismatch: reference to .init.text.1:calibrate_delay (between 'check_cx686_slop' and 'set_cx86_reorder') WARNING: vmlinux.o(.text+0x25102): Section mismatch: reference to .init.text.1:calibrate_delay (between 'smp_callin' and 'cpu_coregroup_map') Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Richard Henderson <rth@twiddle.net> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Christian Zankel <chris@zankel.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/alpha/kernel/smp.c4
-rw-r--r--arch/frv/kernel/setup.c2
-rw-r--r--arch/ia64/kernel/smpboot.c1
-rw-r--r--arch/mips/kernel/smp.c1
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c2
-rw-r--r--arch/sparc/kernel/sun4d_smp.c4
-rw-r--r--arch/sparc/kernel/sun4m_smp.c5
-rw-r--r--arch/sparc64/kernel/smp.c2
-rw-r--r--arch/x86/kernel/cpu/cyrix.c2
-rw-r--r--arch/x86/kernel/smpboot_32.c2
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c2
-rw-r--r--arch/xtensa/kernel/time.c2
-rw-r--r--drivers/s390/sysinfo.c2
-rw-r--r--init/calibrate.c6
14 files changed, 9 insertions, 28 deletions
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index f4ab233201b2..63c2073401ee 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -77,10 +77,6 @@ int smp_num_probed; /* Internal processor count */
77int smp_num_cpus = 1; /* Number that came online. */ 77int smp_num_cpus = 1; /* Number that came online. */
78EXPORT_SYMBOL(smp_num_cpus); 78EXPORT_SYMBOL(smp_num_cpus);
79 79
80extern void calibrate_delay(void);
81
82
83
84/* 80/*
85 * Called by both boot and secondaries to move global data into 81 * Called by both boot and secondaries to move global data into
86 * per-processor storage. 82 * per-processor storage.
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
index a74c08786b21..b38ae1fc15fd 100644
--- a/arch/frv/kernel/setup.c
+++ b/arch/frv/kernel/setup.c
@@ -708,7 +708,7 @@ static void __init reserve_dma_coherent(void)
708/* 708/*
709 * calibrate the delay loop 709 * calibrate the delay loop
710 */ 710 */
711void __init calibrate_delay(void) 711void __cpuinit calibrate_delay(void)
712{ 712{
713 loops_per_jiffy = __delay_loops_MHz * (1000000 / HZ); 713 loops_per_jiffy = __delay_loops_MHz * (1000000 / HZ);
714 714
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 480b1a5085d5..328fd2fd5f44 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -120,7 +120,6 @@ static volatile unsigned long go[SLAVE + 1];
120 120
121#define DEBUG_ITC_SYNC 0 121#define DEBUG_ITC_SYNC 0
122 122
123extern void __devinit calibrate_delay (void);
124extern void start_ap (void); 123extern void start_ap (void);
125extern unsigned long ia64_iobase; 124extern unsigned long ia64_iobase;
126 125
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 1e5dfc28294a..9d41dab90a80 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -52,7 +52,6 @@ int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
52EXPORT_SYMBOL(phys_cpu_present_map); 52EXPORT_SYMBOL(phys_cpu_present_map);
53EXPORT_SYMBOL(cpu_online_map); 53EXPORT_SYMBOL(cpu_online_map);
54 54
55extern void __init calibrate_delay(void);
56extern void cpu_idle(void); 55extern void cpu_idle(void);
57 56
58/* Number of TCs (or siblings in Intel speak) per CPU core */ 57/* Number of TCs (or siblings in Intel speak) per CPU core */
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index c04abcc28a7a..792d3ce8112e 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -113,8 +113,6 @@ static inline void debug_calc_bogomips(void)
113 * result. We backup/restore the value to avoid affecting the 113 * result. We backup/restore the value to avoid affecting the
114 * core cpufreq framework's own calculation. 114 * core cpufreq framework's own calculation.
115 */ 115 */
116 extern void calibrate_delay(void);
117
118 unsigned long save_lpj = loops_per_jiffy; 116 unsigned long save_lpj = loops_per_jiffy;
119 calibrate_delay(); 117 calibrate_delay();
120 loops_per_jiffy = save_lpj; 118 loops_per_jiffy = save_lpj;
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 89a6de95070c..0def48158c7d 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -19,12 +19,12 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/swap.h> 20#include <linux/swap.h>
21#include <linux/profile.h> 21#include <linux/profile.h>
22#include <linux/delay.h>
22 23
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
24#include <asm/atomic.h> 25#include <asm/atomic.h>
25#include <asm/irq_regs.h> 26#include <asm/irq_regs.h>
26 27
27#include <asm/delay.h>
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/page.h> 29#include <asm/page.h>
30#include <asm/pgalloc.h> 30#include <asm/pgalloc.h>
@@ -41,8 +41,6 @@
41 41
42extern ctxd_t *srmmu_ctx_table_phys; 42extern ctxd_t *srmmu_ctx_table_phys;
43 43
44extern void calibrate_delay(void);
45
46static volatile int smp_processors_ready = 0; 44static volatile int smp_processors_ready = 0;
47static int smp_highest_cpu; 45static int smp_highest_cpu;
48extern volatile unsigned long cpu_callin_map[NR_CPUS]; 46extern volatile unsigned long cpu_callin_map[NR_CPUS];
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 730eb5796f8e..0b9407267162 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -16,6 +16,8 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/swap.h> 17#include <linux/swap.h>
18#include <linux/profile.h> 18#include <linux/profile.h>
19#include <linux/delay.h>
20
19#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
20#include <asm/tlbflush.h> 22#include <asm/tlbflush.h>
21#include <asm/irq_regs.h> 23#include <asm/irq_regs.h>
@@ -23,7 +25,6 @@
23#include <asm/ptrace.h> 25#include <asm/ptrace.h>
24#include <asm/atomic.h> 26#include <asm/atomic.h>
25 27
26#include <asm/delay.h>
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/page.h> 29#include <asm/page.h>
29#include <asm/pgalloc.h> 30#include <asm/pgalloc.h>
@@ -39,8 +40,6 @@
39 40
40extern ctxd_t *srmmu_ctx_table_phys; 41extern ctxd_t *srmmu_ctx_table_phys;
41 42
42extern void calibrate_delay(void);
43
44extern volatile unsigned long cpu_callin_map[NR_CPUS]; 43extern volatile unsigned long cpu_callin_map[NR_CPUS];
45extern unsigned char boot_cpu_id; 44extern unsigned char boot_cpu_id;
46 45
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index c39944927f1a..a8052b76df41 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -46,8 +46,6 @@
46#include <asm/ldc.h> 46#include <asm/ldc.h>
47#include <asm/hypervisor.h> 47#include <asm/hypervisor.h>
48 48
49extern void calibrate_delay(void);
50
51int sparc64_multi_core __read_mostly; 49int sparc64_multi_core __read_mostly;
52 50
53cpumask_t cpu_possible_map __read_mostly = CPU_MASK_NONE; 51cpumask_t cpu_possible_map __read_mostly = CPU_MASK_NONE;
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 404a6a2d4016..7139b0262703 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -83,8 +83,6 @@ static char cyrix_model_mult2[] __cpuinitdata = "12233445";
83 * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP 83 * FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP
84 */ 84 */
85 85
86extern void calibrate_delay(void) __init;
87
88static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c) 86static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c)
89{ 87{
90 unsigned long flags; 88 unsigned long flags;
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
index 5787a0c3e296..579b9b740c7c 100644
--- a/arch/x86/kernel/smpboot_32.c
+++ b/arch/x86/kernel/smpboot_32.c
@@ -202,8 +202,6 @@ valid_k7:
202 ; 202 ;
203} 203}
204 204
205extern void calibrate_delay(void);
206
207static atomic_t init_deasserted; 205static atomic_t init_deasserted;
208 206
209static void __cpuinit smp_callin(void) 207static void __cpuinit smp_callin(void)
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
index dffa786f61fe..3cc8eb2f36a9 100644
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@ -444,8 +444,6 @@ static __u32 __init setup_trampoline(void)
444static void __init start_secondary(void *unused) 444static void __init start_secondary(void *unused)
445{ 445{
446 __u8 cpuid = hard_smp_processor_id(); 446 __u8 cpuid = hard_smp_processor_id();
447 /* external functions not defined in the headers */
448 extern void calibrate_delay(void);
449 447
450 cpu_init(); 448 cpu_init();
451 449
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index 60d29fe0b1bd..8df1e842f6d4 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -204,7 +204,7 @@ again:
204} 204}
205 205
206#ifndef CONFIG_GENERIC_CALIBRATE_DELAY 206#ifndef CONFIG_GENERIC_CALIBRATE_DELAY
207void __devinit calibrate_delay(void) 207void __cpuinit calibrate_delay(void)
208{ 208{
209 loops_per_jiffy = CCOUNT_PER_JIFFY; 209 loops_per_jiffy = CCOUNT_PER_JIFFY;
210 printk("Calibrating delay loop (skipped)... " 210 printk("Calibrating delay loop (skipped)... "
diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c
index 19343f9675c3..291ff6235fe2 100644
--- a/drivers/s390/sysinfo.c
+++ b/drivers/s390/sysinfo.c
@@ -422,7 +422,7 @@ void s390_adjust_jiffies(void)
422/* 422/*
423 * calibrate the delay loop 423 * calibrate the delay loop
424 */ 424 */
425void __init calibrate_delay(void) 425void __cpuinit calibrate_delay(void)
426{ 426{
427 s390_adjust_jiffies(); 427 s390_adjust_jiffies();
428 /* Print the good old Bogomips line .. */ 428 /* Print the good old Bogomips line .. */
diff --git a/init/calibrate.c b/init/calibrate.c
index 1d87891b6fcd..ecb3822d4f70 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -28,7 +28,7 @@ __setup("lpj=", lpj_setup);
28#define DELAY_CALIBRATION_TICKS ((HZ < 100) ? 1 : (HZ/100)) 28#define DELAY_CALIBRATION_TICKS ((HZ < 100) ? 1 : (HZ/100))
29#define MAX_DIRECT_CALIBRATION_RETRIES 5 29#define MAX_DIRECT_CALIBRATION_RETRIES 5
30 30
31static unsigned long __devinit calibrate_delay_direct(void) 31static unsigned long __cpuinit calibrate_delay_direct(void)
32{ 32{
33 unsigned long pre_start, start, post_start; 33 unsigned long pre_start, start, post_start;
34 unsigned long pre_end, end, post_end; 34 unsigned long pre_end, end, post_end;
@@ -101,7 +101,7 @@ static unsigned long __devinit calibrate_delay_direct(void)
101 return 0; 101 return 0;
102} 102}
103#else 103#else
104static unsigned long __devinit calibrate_delay_direct(void) {return 0;} 104static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;}
105#endif 105#endif
106 106
107/* 107/*
@@ -111,7 +111,7 @@ static unsigned long __devinit calibrate_delay_direct(void) {return 0;}
111 */ 111 */
112#define LPS_PREC 8 112#define LPS_PREC 8
113 113
114void __devinit calibrate_delay(void) 114void __cpuinit calibrate_delay(void)
115{ 115{
116 unsigned long ticks, loopbit; 116 unsigned long ticks, loopbit;
117 int lps_precision = LPS_PREC; 117 int lps_precision = LPS_PREC;