[patch] fix sparc64 cpu_idle()

From: Coywolf Qi Hunt
Date: Wed Dec 29 2004 - 14:11:35 EST


On Mon, 27 Dec 2004 08:08:48 -0800, William Lee Irwin III
<wli@xxxxxxxxxxxxxx> wrote:
> On Mon, Dec 27, 2004 at 07:10:38PM +0300, Oleg Nesterov wrote:
> > cpu_idle() 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)
>
> It's remarkable that several arches are internally inconsistent. Anyway,
> this will likely be a shoo-in, as it removes more code than it adds. The
> mess surrounding cpu_idle() has been aggravating for some time.


It's not flexible to enforce 'void cpu_idle(void)' all over. What If
someday someone would want cpu_idle() to return value for some arch.


Currently sparch64's UP cpu_idel() returns -EPERM. This is paranoia.

Signed-off-by: Coywolf Qi Hunt <coywolf@xxxxxxxxx>
diff -Nurp 2.6.10/arch/sparc64/kernel/process.c
2.6.10-cy/arch/sparc64/kernel/process.c
--- 2.6.10/arch/sparc64/kernel/process.c 2004-12-30 02:52:40.000000000 +0800
+++ 2.6.10-cy/arch/sparc64/kernel/process.c 2004-12-30 02:57:40.000000000 +0800
@@ -60,11 +60,8 @@ void default_idle(void)
/*
* the idle loop on a Sparc... ;)
*/
-int cpu_idle(void)
+void cpu_idle(void)
{
- if (current->pid != 0)
- return -EPERM;
-
/* endless idle loop with no priority at all */
for (;;) {
/* If current->work.need_resched is zero we should really
@@ -80,7 +77,6 @@ int cpu_idle(void)
schedule();
check_pgt_cache();
}
- return 0;
}

#else

--
Coywolf Qi Hunt
Homepage http://sosdg.org/~coywolf/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/