Hi,

This very small patches re-orders 2 if-statements so that in the
most common case 1 less if-statement is executed, in the worst
case the same number of if-statements is executed (doesn't matter
though: it's would be the fault-situation anyway).

diff -ur --minimal linux-vanilla/kernel/exit.c linux-2.4.2/kernel/exit.c
--- linux-vanilla/kernel/exit.c Mon Mar 26 09:28:13 2001
+++ linux-2.4.2/kernel/exit.c   Mon Mar 26 10:50:30 2001
@@ -425,10 +425,12 @@
 
        if (in_interrupt())
                panic("Aiee, killing interrupt handler!");
-       if (!tsk->pid)
-               panic("Attempted to kill the idle task!");
-       if (tsk->pid == 1)
-               panic("Attempted to kill init!");
+       if (tsk->pid <= 1) {
+               if (tsk->pid)
+                       panic("Attempted to kill init!");
+               else
+                       panic("Attempted to kill the idle task!");
+       }
        tsk->flags |= PF_EXITING;
        del_timer_sync(&tsk->real_timer);


Greetings,

Folkert van Heusden ([EMAIL PROTECTED])
[ www.vanheusden.com ]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to