Skip to content

Commit 6c81c32

Browse files
AdrianBunkLinus Torvalds
authored andcommitted
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>
1 parent eb38a99 commit 6c81c32

14 files changed

Lines changed: 9 additions & 28 deletions

File tree

‎arch/alpha/kernel/smp.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ int smp_num_probed; /* Internal processor count */
7777
int smp_num_cpus = 1; /* Number that came online. */
7878
EXPORT_SYMBOL(smp_num_cpus);
7979

80-
extern void calibrate_delay(void);
81-
82-
83-
8480
/*
8581
* Called by both boot and secondaries to move global data into
8682
* per-processor storage.

‎arch/frv/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static void __init reserve_dma_coherent(void)
708708
/*
709709
* calibrate the delay loop
710710
*/
711-
void __init calibrate_delay(void)
711+
void __cpuinit calibrate_delay(void)
712712
{
713713
loops_per_jiffy = __delay_loops_MHz * (1000000 / HZ);
714714

‎arch/ia64/kernel/smpboot.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ static volatile unsigned long go[SLAVE + 1];
120120

121121
#define DEBUG_ITC_SYNC 0
122122

123-
extern void __devinit calibrate_delay (void);
124123
extern void start_ap (void);
125124
extern unsigned long ia64_iobase;
126125

‎arch/mips/kernel/smp.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
5252
EXPORT_SYMBOL(phys_cpu_present_map);
5353
EXPORT_SYMBOL(cpu_online_map);
5454

55-
extern void __init calibrate_delay(void);
5655
extern void cpu_idle(void);
5756

5857
/* Number of TCs (or siblings in Intel speak) per CPU core */

‎arch/powerpc/platforms/powermac/cpufreq_32.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ static inline void debug_calc_bogomips(void)
113113
* result. We backup/restore the value to avoid affecting the
114114
* core cpufreq framework's own calculation.
115115
*/
116-
extern void calibrate_delay(void);
117-
118116
unsigned long save_lpj = loops_per_jiffy;
119117
calibrate_delay();
120118
loops_per_jiffy = save_lpj;

‎arch/sparc/kernel/sun4d_smp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
#include <linux/mm.h>
2020
#include <linux/swap.h>
2121
#include <linux/profile.h>
22+
#include <linux/delay.h>
2223

2324
#include <asm/ptrace.h>
2425
#include <asm/atomic.h>
2526
#include <asm/irq_regs.h>
2627

27-
#include <asm/delay.h>
2828
#include <asm/irq.h>
2929
#include <asm/page.h>
3030
#include <asm/pgalloc.h>
@@ -41,8 +41,6 @@
4141

4242
extern ctxd_t *srmmu_ctx_table_phys;
4343

44-
extern void calibrate_delay(void);
45-
4644
static volatile int smp_processors_ready = 0;
4745
static int smp_highest_cpu;
4846
extern volatile unsigned long cpu_callin_map[NR_CPUS];

‎arch/sparc/kernel/sun4m_smp.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
#include <linux/mm.h>
1717
#include <linux/swap.h>
1818
#include <linux/profile.h>
19+
#include <linux/delay.h>
20+
1921
#include <asm/cacheflush.h>
2022
#include <asm/tlbflush.h>
2123
#include <asm/irq_regs.h>
2224

2325
#include <asm/ptrace.h>
2426
#include <asm/atomic.h>
2527

26-
#include <asm/delay.h>
2728
#include <asm/irq.h>
2829
#include <asm/page.h>
2930
#include <asm/pgalloc.h>
@@ -39,8 +40,6 @@
3940

4041
extern ctxd_t *srmmu_ctx_table_phys;
4142

42-
extern void calibrate_delay(void);
43-
4443
extern volatile unsigned long cpu_callin_map[NR_CPUS];
4544
extern unsigned char boot_cpu_id;
4645

‎arch/sparc64/kernel/smp.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
#include <asm/ldc.h>
4747
#include <asm/hypervisor.h>
4848

49-
extern void calibrate_delay(void);
50-
5149
int sparc64_multi_core __read_mostly;
5250

5351
cpumask_t cpu_possible_map __read_mostly = CPU_MASK_NONE;

‎arch/x86/kernel/cpu/cyrix.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ static char cyrix_model_mult2[] __cpuinitdata = "12233445";
8383
* FIXME: our newer udelay uses the tsc. We don't need to frob with SLOP
8484
*/
8585

86-
extern void calibrate_delay(void) __init;
87-
8886
static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c)
8987
{
9088
unsigned long flags;

‎arch/x86/kernel/smpboot_32.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ void __cpuinit smp_store_cpu_info(int id)
202202
;
203203
}
204204

205-
extern void calibrate_delay(void);
206-
207205
static atomic_t init_deasserted;
208206

209207
static void __cpuinit smp_callin(void)

0 commit comments

Comments
 (0)