arch/ppc/kernel/idle.c: don't declare cpu variable in non-SMP kernels
PATCH 1/1 arch/ppc/kernel/idle.c: don't declare cpu variable in non-SMP kernels
Disable declaration of cpu variable in default_idle function when building non-SMP kernels.
Signed-off-by Otavio Salvador <[email protected]>
---
arch/ppc/kernel/idle.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
applies-to: 06378a021f5873003a07f0388aa0cb6e81a32c19 156ff805b4408c6831c7840c1ed1fe3d148bc3c8
arch/ppc/kernel/idle.c +2 -0
@@ -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;
---
0.99.9k
Quoted 7 lines · Otavio Salvador
Disable declaration of cpu variable in
default_idlefunction when building non-SMP kernels.
arch/ppc/kernel/idle.c line 45
Quoted 9 lines
arch/ppc/kernel/idle.c +2
-0@@ -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?
arch/ppc/kernel/idle.c renamed from arch/ppc/kernel/idle.c~a +2 -2
@@ -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 ); }
_
Quoted 1 line · Andrew Morton
Surely this would be better?
Yes it would, care to give me a signed-off-by for it? :)
Paul.
arch/ppc/kernel/idle.c line 42
Quoted 11 lines
arch/ppc/kernel/idle.c +2
-0@@ -37,7 +37,9 @@void default_idle (void ) {void (*powersave)(void ); +#ifdef CONFIG_SMP int cpu =smp_processor_id (); +#endif
Better to just move the declaration of cpu down to the ifdef'd else block further down in the function as that's the only place it is used.