hrtimer: don't modify restart_block->fn in restart functions
authorOleg Nesterov <oleg@tv-sign.ru>
Fri, 1 Feb 2008 17:41:30 +0000 (20:41 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 10 Feb 2008 09:48:03 +0000 (10:48 +0100)
hrtimer_nanosleep_restart() clears/restores restart_block->fn. This is
pointless and complicates its usage. Note that if sys_restart_syscall()
doesn't actually happen, we have a bogus "pending" restart->fn anyway,
this is harmless.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Pavel Emelyanov <xemul@sw.ru>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Toyo Abe <toyoa@mvista.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/compat.c
kernel/hrtimer.c

index f2a2975..5f0e201 100644 (file)
@@ -55,7 +55,6 @@ static long compat_nanosleep_restart(struct restart_block *restart)
        set_fs(oldfs);
 
        if (ret) {
-               restart->fn = compat_nanosleep_restart;
                restart->arg1 = (unsigned long)rmtp;
 
                if (rmtp && put_compat_timespec(&rmt, rmtp))
index 355085f..3f4a57c 100644 (file)
@@ -1340,8 +1340,6 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
        struct hrtimer_sleeper t;
        struct timespec __user  *rmtp;
 
-       restart->fn = do_no_restart_syscall;
-
        hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS);
        t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2;
 
@@ -1355,8 +1353,6 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
                        return ret;
        }
 
-       restart->fn = hrtimer_nanosleep_restart;
-
        /* The other values in restart are already filled in */
        return -ERESTART_RESTARTBLOCK;
 }