Re: [patch] fix sparc64 cpu_idle()

Coywolf Qi Hunt
2004-12-29T19:52:35Z

Currently sparc and sparc64's UP cpu_idel() checks current pid. This
is paranoia.

Signed-off-by: Coywolf Qi Hunt <coywolf@gmail.com>

sparc/kernel/process.c | 10 +---------
sparc64/kernel/process.c | 6 +-----
2 files changed, 2 insertions(+), 14 deletions(-)

diff -Nurp 2.6.10/arch/sparc/kernel/process.c
2.6.10-cy/arch/sparc/kernel/process.c
--- 2.6.10/arch/sparc/kernel/process.c 2004-12-29 01:27:57.000000000 +0800
+++ 2.6.10-cy/arch/sparc/kernel/process.c 2004-12-30 03:41:53.000000000 +0800
@@ -81,13 +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;
-
/* endless idle loop with no priority at all */
for (;;) {
if (ARCH_SUN4C_SUN4) {
@@ -128,9 +123,6 @@ int cpu_idle(void)
schedule();
check_pgt_cache();
}
- ret = 0;
-out:
- return ret;
}

#else
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/