[PATCH] arch/ppc/kernel/idle.c: don't declare cpu variable in non-SMP kernels
Andrew Morton
akpm at osdl.org
Sun Dec 4 05:46:39 EST 2005
Otavio Salvador <otavio at debian.org> wrote:
>
> Disable declaration of cpu variable in default_idle function when
> building non-SMP kernels.
>
> --- a/arch/ppc/kernel/idle.c
> +++ b/arch/ppc/kernel/idle.c
> @@ -37,7 +37,9 @@
> void default_idle(void)
> {
> void (*powersave)(void);
> +#ifdef CONFIG_SMP
> int cpu = smp_processor_id();
> +#endif
>
> powersave = ppc_md.power_save;
>
Surely this would be better?
--- devel/arch/ppc/kernel/idle.c~a 2005-12-03 10:45:37.000000000 -0800
+++ devel-akpm/arch/ppc/kernel/idle.c 2005-12-03 10:46:03.000000000 -0800
@@ -37,7 +37,6 @@
void default_idle(void)
{
void (*powersave)(void);
- int cpu = smp_processor_id();
powersave = ppc_md.power_save;
@@ -47,7 +46,8 @@ void default_idle(void)
#ifdef CONFIG_SMP
else {
set_thread_flag(TIF_POLLING_NRFLAG);
- while (!need_resched() && !cpu_is_offline(cpu))
+ while (!need_resched() &&
+ !cpu_is_offline(smp_processor_id()))
barrier();
clear_thread_flag(TIF_POLLING_NRFLAG);
}
_
More information about the Linuxppc-dev
mailing list