]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/posix-timers.c
cgroup: annotate cgroup_init_subsys with __init
[linux-2.6-omap-h63xx.git] / kernel / posix-timers.c
index ce268966007d6f71904cd8229939f6fb9a2324c5..8476956ffd9238a378f6c5671649900776939dd0 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/mutex.h>
 
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <linux/list.h>
 #include <linux/init.h>
 #include <linux/compiler.h>
@@ -767,9 +766,11 @@ common_timer_set(struct k_itimer *timr, int flags,
        /* SIGEV_NONE timers are not queued ! See common_timer_get */
        if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
                /* Setup correct expiry time for relative timers */
-               if (mode == HRTIMER_MODE_REL)
-                       timer->expires = ktime_add(timer->expires,
-                                                  timer->base->get_time());
+               if (mode == HRTIMER_MODE_REL) {
+                       timer->expires =
+                               ktime_add_safe(timer->expires,
+                                              timer->base->get_time());
+               }
                return 0;
        }
 
@@ -982,20 +983,9 @@ sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp)
 static int common_nsleep(const clockid_t which_clock, int flags,
                         struct timespec *tsave, struct timespec __user *rmtp)
 {
-       struct timespec rmt;
-       int ret;
-
-       ret = hrtimer_nanosleep(tsave, rmtp ? &rmt : NULL,
-                               flags & TIMER_ABSTIME ?
-                               HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
-                               which_clock);
-
-       if (ret && rmtp) {
-               if (copy_to_user(rmtp, &rmt, sizeof(*rmtp)))
-                       return -EFAULT;
-       }
-
-       return ret;
+       return hrtimer_nanosleep(tsave, rmtp, flags & TIMER_ABSTIME ?
+                                HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
+                                which_clock);
 }
 
 asmlinkage long