lkml.org 
[lkml]   [2011]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [patch 20/28] posix-timers: Make posix-cpu-timers functions static
    From
    Date
    On Tue, 2011-02-01 at 13:52 +0000, Thomas Gleixner wrote:
    > plain text document attachment
    > (posix-timer-make-posix-cpu-timer-functions-static.patch)
    > All functions are accessed via clock_posix_cpu now. So make them static.
    >
    > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    > Cc: John Stultz <john.stultz@linaro.org>
    > Cc: Richard Cochran <richard.cochran@omicron.at>

    This patch seems to have more then just making functions static in it.

    > @@ -1481,68 +1483,67 @@ static int do_cpu_nanosleep(const clocki
    > return error;
    > }
    >
    > -int posix_cpu_nsleep(const clockid_t which_clock, int flags,
    > - struct timespec *rqtp, struct timespec __user *rmtp)
    > +static long posix_cpu_nsleep_restart(struct restart_block *restart_block)
    > {
    > - struct restart_block *restart_block =
    > - &current_thread_info()->restart_block;
    > + clockid_t which_clock = restart_block->nanosleep.index;
    > + struct timespec t;
    > struct itimerspec it;
    > int error;
    >
    > - /*
    > - * Diagnose required errors first.
    > - */
    > - if (CPUCLOCK_PERTHREAD(which_clock) &&
    > - (CPUCLOCK_PID(which_clock) == 0 ||
    > - CPUCLOCK_PID(which_clock) == current->pid))
    > - return -EINVAL;
    > + t = ns_to_timespec(restart_block->nanosleep.expires);
    >
    > - error = do_cpu_nanosleep(which_clock, flags, rqtp, &it);
    > + error = do_cpu_nanosleep(which_clock, TIMER_ABSTIME, &t, &it);
    >
    > if (error == -ERESTART_RESTARTBLOCK) {
    > -
    > - if (flags & TIMER_ABSTIME)
    > - return -ERESTARTNOHAND;
    > + struct timespec __user *rmtp = restart_block->nanosleep.rmtp;
    > /*
    > * Report back to the user the time still remaining.
    > */
    > if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof *rmtp))
    > return -EFAULT;
    >
    > - restart_block->fn = posix_cpu_nsleep_restart;
    > - restart_block->nanosleep.index = which_clock;
    > - restart_block->nanosleep.rmtp = rmtp;
    > - restart_block->nanosleep.expires = timespec_to_ns(rqtp);
    > + restart_block->nanosleep.expires = timespec_to_ns(&t);
    > }
    > return error;
    > +
    > }
    >
    > -long posix_cpu_nsleep_restart(struct restart_block *restart_block)
    > +static int posix_cpu_nsleep(const clockid_t which_clock, int flags,
    > + struct timespec *rqtp, struct timespec __user *rmtp)
    > {
    > - clockid_t which_clock = restart_block->nanosleep.index;
    > - struct timespec t;
    > + struct restart_block *restart_block =
    > + &current_thread_info()->restart_block;
    > struct itimerspec it;
    > int error;
    >
    > - t = ns_to_timespec(restart_block->nanosleep.expires);
    > + /*
    > + * Diagnose required errors first.
    > + */
    > + if (CPUCLOCK_PERTHREAD(which_clock) &&
    > + (CPUCLOCK_PID(which_clock) == 0 ||
    > + CPUCLOCK_PID(which_clock) == current->pid))
    > + return -EINVAL;
    >
    > - error = do_cpu_nanosleep(which_clock, TIMER_ABSTIME, &t, &it);
    > + error = do_cpu_nanosleep(which_clock, flags, rqtp, &it);
    >
    > if (error == -ERESTART_RESTARTBLOCK) {
    > - struct timespec __user *rmtp = restart_block->nanosleep.rmtp;
    > +
    > + if (flags & TIMER_ABSTIME)
    > + return -ERESTARTNOHAND;
    > /*
    > * Report back to the user the time still remaining.
    > */
    > if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof *rmtp))
    > return -EFAULT;
    >
    > - restart_block->nanosleep.expires = timespec_to_ns(&t);
    > + restart_block->fn = posix_cpu_nsleep_restart;
    > + restart_block->nanosleep.index = which_clock;
    > + restart_block->nanosleep.rmtp = rmtp;
    > + restart_block->nanosleep.expires = timespec_to_ns(rqtp);
    > }
    > return error;
    > -
    > }

    Maybe split that out?

    thanks
    -john




    \
     
     \ /
      Last update: 2011-02-01 22:31    [W:4.038 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site