Don't try to "validate" a non-existing timeval.
[pandora-kernel.git] / kernel / time.c
index cf5a458..1f23e68 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <linux/module.h>
 #include <linux/timex.h>
+#include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/smp_lock.h>
 #include <linux/syscalls.h>
@@ -154,7 +155,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
        static int firsttime = 1;
        int error = 0;
 
-       if (!timespec_valid(tv))
+       if (tv && !timespec_valid(tv))
                return -EINVAL;
 
        error = security_settime(tv, tz);
@@ -564,28 +565,6 @@ void getnstimeofday(struct timespec *tv)
 EXPORT_SYMBOL_GPL(getnstimeofday);
 #endif
 
-void getnstimestamp(struct timespec *ts)
-{
-       unsigned int seq;
-       struct timespec wall2mono;
-
-       /* synchronize with settimeofday() changes */
-       do {
-               seq = read_seqbegin(&xtime_lock);
-               getnstimeofday(ts);
-               wall2mono = wall_to_monotonic;
-       } while(unlikely(read_seqretry(&xtime_lock, seq)));
-
-       /* adjust to monotonicaly-increasing values */
-       ts->tv_sec += wall2mono.tv_sec;
-       ts->tv_nsec += wall2mono.tv_nsec;
-       while (unlikely(ts->tv_nsec >= NSEC_PER_SEC)) {
-               ts->tv_nsec -= NSEC_PER_SEC;
-               ts->tv_sec++;
-       }
-}
-EXPORT_SYMBOL_GPL(getnstimestamp);
-
 /* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
  * Assumes input in normal date format, i.e. 1980-12-31 23:59:59
  * => year=1980, mon=12, day=31, hour=23, min=59, sec=59.