Commit 2612d7a4 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

[PATCH] fix conflicting cpu_idle() declarations

cpu_idle() is referenced from generic code (init/main.c).  It is
declared/defined in

init/main.c:				void cpu_idle(void)

i386/kernel/process.c			void cpu_idle(void)
i386/kernel/smpboot.c:			int  cpu_idle(void)
i386/mach-voyager/voyager_smp.c:	int  cpu_idle(void)

ppc/kernel/idle.c:			int  cpu_idle(void)
ppc/kernel/smp.c:			int  cpu_idle(void *unused)

ppc64/kernel/idle.c:			int  cpu_idle(void)
ppc64/kernel/smp.c:			int  cpu_idle(void *unused)

sparc/kernel/process.c:			int  cpu_idle(void)

sparc64/kernel/process.c:		int  cpu_idle(void)

sh/kernel/process.c:			void cpu_idle(void *unused)
sh/kernel/smp.c:			int  cpu_idle(void *unused)

ia64/kernel/smpboot.c:			int  cpu_idle(void)
ia64/kernel/process.c:			void cpu_idle(void *unused)

sh64/kernel/process.c:			void cpu_idle(void *unused)

s390/kernel/process.c:			int  cpu_idle(void)
s390/kernel/smp.c:			int  cpu_idle(void * unused)

m32r/kernel/process.c:			void cpu_idle(void)
m32r/kernel/smpboot.c			int  cpu_idle(void)

Other arches beleive that cpu_idle is void(void).

This patch puts 'void cpu_idle(void)' in include/linux/smp.h
and fixes conflicting definitions.

Also removes now unneeded declarations in x86_64, alpha, parisc.

Only i386 part is tested.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent db43a998
......@@ -167,9 +167,6 @@ extern void entSys(void);
extern void entUna(void);
extern void entDbg(void);
/* process.c */
extern void cpu_idle(void) __attribute__((noreturn));
/* ptrace.c */
extern int ptrace_set_bpt (struct task_struct *child);
extern int ptrace_cancel_bpt (struct task_struct *child);
......
......@@ -411,12 +411,10 @@ void __init smp_callin(void)
int cpucount;
extern int cpu_idle(void);
/*
* Activate a secondary processor.
*/
int __init start_secondary(void *unused)
static void __init start_secondary(void *unused)
{
/*
* Dont put anything before smp_callin(), SMP
......@@ -441,7 +439,7 @@ int __init start_secondary(void *unused)
local_flush_tlb();
cpu_set(smp_processor_id(), cpu_online_map);
wmb();
return cpu_idle();
cpu_idle();
}
/*
......
......@@ -457,13 +457,12 @@ setup_trampoline(void)
}
/* Routine initially called when a non-boot CPU is brought online */
int __init
static void __init
start_secondary(void *unused)
{
__u8 cpuid = hard_smp_processor_id();
/* external functions not defined in the headers */
extern void calibrate_delay(void);
extern int cpu_idle(void);
cpu_init();
......@@ -520,7 +519,7 @@ start_secondary(void *unused)
cpu_set(cpuid, cpu_online_map);
wmb();
return cpu_idle();
cpu_idle();
}
......
......@@ -245,7 +245,7 @@ void cpu_idle_wait(void)
EXPORT_SYMBOL_GPL(cpu_idle_wait);
void __attribute__((noreturn))
cpu_idle (void *unused)
cpu_idle (void)
{
void (*mark_idle)(int) = ia64_mark_idle;
int cpu = smp_processor_id();
......
......@@ -343,8 +343,6 @@ smp_callin (void)
int __devinit
start_secondary (void *unused)
{
extern int cpu_idle (void);
/* Early console may use I/O ports */
ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase));
......@@ -353,7 +351,8 @@ start_secondary (void *unused)
cpu_init();
smp_callin();
return cpu_idle();
cpu_idle();
return 0;
}
struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
......
......@@ -58,7 +58,6 @@
#define Dprintk(x...)
#endif
extern int cpu_idle(void);
extern cpumask_t cpu_initialized;
/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
......@@ -443,7 +442,8 @@ int __init start_secondary(void *unused)
*/
local_flush_tlb_all();
return cpu_idle();
cpu_idle();
return 0;
}
/*==========================================================================*
......
......@@ -459,7 +459,6 @@ smp_cpu_init(int cpunum)
*/
void __init smp_callin(void)
{
extern void cpu_idle(void); /* arch/parisc/kernel/process.c */
int slave_id = cpu_now_booting;
#if 0
void *istack;
......
......@@ -57,14 +57,13 @@ void default_idle(void)
/*
* The body of the idle task.
*/
int cpu_idle(void)
void cpu_idle(void)
{
for (;;)
if (ppc_md.idle != NULL)
ppc_md.idle();
else
default_idle();
return 0;
}
#if defined(CONFIG_SYSCTL) && defined(CONFIG_6xx)
......
......@@ -60,7 +60,6 @@ static struct smp_ops_t *smp_ops;
volatile unsigned long cpu_callin_map[NR_CPUS];
int start_secondary(void *);
extern int cpu_idle(void *unused);
void smp_call_function_interrupt(void);
static int __smp_call_function(void (*func) (void *info), void *info,
int wait, int target);
......@@ -358,7 +357,8 @@ int __devinit start_secondary(void *unused)
smp_ops->take_timebase();
printk("CPU %i done timebase take...\n", cpu);
return cpu_idle(NULL);
cpu_idle();
return 0;
}
int __cpu_up(unsigned int cpu)
......
......@@ -299,10 +299,9 @@ static int native_idle(void)
#endif /* CONFIG_PPC_ISERIES */
int cpu_idle(void)
void cpu_idle(void)
{
idle_loop();
return 0;
}
int powersave_nap;
......
......@@ -73,7 +73,6 @@ static volatile unsigned int cpu_callin_map[NR_CPUS];
extern unsigned char stab_array[];
extern int cpu_idle(void *unused);
void smp_call_function_interrupt(void);
int smt_enabled_at_boot = 1;
......@@ -517,7 +516,8 @@ int __devinit start_secondary(void *unused)
local_irq_enable();
return cpu_idle(NULL);
cpu_idle();
return 0;
}
int setup_profiling_timer(unsigned int multiplier)
......
......@@ -159,11 +159,10 @@ void default_idle(void)
#endif /* CONFIG_ARCH_S390X */
}
int cpu_idle(void)
void cpu_idle(void)
{
for (;;)
default_idle();
return 0;
}
void show_regs(struct pt_regs *regs)
......
......@@ -42,7 +42,6 @@
#include <asm/tlbflush.h>
/* prototypes */
extern int cpu_idle(void * unused);
extern volatile int __cpu_logical_map[];
......@@ -557,7 +556,8 @@ int __devinit start_secondary(void *cpuvoid)
/* Print info about this processor */
print_cpu_info(&S390_lowcore.cpu_data);
/* cpu_idle will call schedule for us */
return cpu_idle(NULL);
cpu_idle();
return 0;
}
static void __init smp_create_idle(unsigned int cpu)
......
......@@ -68,7 +68,7 @@ void default_idle(void)
}
}
void cpu_idle(void *unused)
void cpu_idle(void)
{
default_idle();
}
......
......@@ -37,7 +37,6 @@
int smp_threads_ready = 0;
struct sh_cpuinfo cpu_data[NR_CPUS];
extern int cpu_idle(void *unused);
extern void per_cpu_trap_init(void);
cpumask_t cpu_possible_map;
......@@ -124,7 +123,8 @@ int start_secondary(void *unused)
atomic_inc(&cpus_booted);
return cpu_idle(0);
cpu_idle();
return 0;
}
void __init smp_cpus_done(unsigned int max_cpus)
......
......@@ -338,7 +338,7 @@ void default_idle(void)
}
}
void cpu_idle(void *unused)
void cpu_idle(void)
{
default_idle();
}
......
......@@ -81,10 +81,8 @@ void default_idle(void)
/*
* the idle loop on a Sparc... ;)
*/
int cpu_idle(void)
void cpu_idle(void)
{
int ret = -EPERM;
if (current->pid != 0)
goto out;
......@@ -128,15 +126,14 @@ int cpu_idle(void)
schedule();
check_pgt_cache();
}
ret = 0;
out:
return ret;
return;
}
#else
/* This is being executed in task 0 'user space'. */
int cpu_idle(void)
void cpu_idle(void)
{
/* endless idle loop with no priority at all */
while(1) {
......
......@@ -145,7 +145,6 @@ void __init smp4d_callin(void)
spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
}
extern int cpu_idle(void *unused);
extern void init_IRQ(void);
extern void cpu_panic(void);
......
......@@ -121,7 +121,6 @@ void __init smp4m_callin(void)
local_irq_enable();
}
extern int cpu_idle(void *unused);
extern void init_IRQ(void);
extern void cpu_panic(void);
......
......@@ -60,10 +60,10 @@ void default_idle(void)
/*
* the idle loop on a Sparc... ;)
*/
int cpu_idle(void)
void cpu_idle(void)
{
if (current->pid != 0)
return -EPERM;
return;
/* endless idle loop with no priority at all */
for (;;) {
......@@ -80,7 +80,7 @@ int cpu_idle(void)
schedule();
check_pgt_cache();
}
return 0;
return;
}
#else
......@@ -90,7 +90,7 @@ int cpu_idle(void)
*/
#define idle_me_harder() (cpu_data(smp_processor_id()).idle_volume += 1)
#define unidle_me() (cpu_data(smp_processor_id()).idle_volume = 0)
int cpu_idle(void)
void cpu_idle(void)
{
set_thread_flag(TIF_POLLING_NRFLAG);
while(1) {
......
......@@ -25,7 +25,6 @@ extern void ia32_syscall(void);
extern void ia32_cstar_target(void);
extern void ia32_sysenter_target(void);
extern void cpu_idle(void);
extern void config_acpi_tables(void);
extern void ia32_syscall(void);
extern void iommu_hole_init(void);
......
......@@ -8,6 +8,8 @@
#include <linux/config.h>
extern void cpu_idle(void);
#ifdef CONFIG_SMP
#include <linux/preempt.h>
......
......@@ -288,7 +288,6 @@ static int __init init_setup(char *str)
__setup("init=", init_setup);
extern void setup_arch(char **);
extern void cpu_idle(void);
#ifndef CONFIG_SMP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment