]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/sparc/kernel/sys_sparc_64.c
Merge tag 'rtc-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
[linux.git] / arch / sparc / kernel / sys_sparc_64.c
index 9f41a6f5a032da07f280c29233525694bbbf8540..6b92fadb6ec7dd7844ad44e7b3ec3860d5e51e0a 100644 (file)
@@ -548,34 +548,35 @@ SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len)
        return err;
 }
 
-SYSCALL_DEFINE1(sparc_adjtimex, struct timex __user *, txc_p)
+SYSCALL_DEFINE1(sparc_adjtimex, struct __kernel_timex __user *, txc_p)
 {
-       struct timex txc;               /* Local copy of parameter */
-       struct __kernel_timex *kt = (void *)&txc;
+       struct __kernel_timex txc;
+       struct __kernel_old_timeval *tv = (void *)&txc.time;
        int ret;
 
        /* Copy the user data space into the kernel copy
         * structure. But bear in mind that the structures
         * may change
         */
-       if (copy_from_user(&txc, txc_p, sizeof(struct timex)))
+       if (copy_from_user(&txc, txc_p, sizeof(txc)))
                return -EFAULT;
 
        /*
         * override for sparc64 specific timeval type: tv_usec
         * is 32 bit wide instead of 64-bit in __kernel_timex
         */
-       kt->time.tv_usec = txc.time.tv_usec;
-       ret = do_adjtimex(kt);
-       txc.time.tv_usec = kt->time.tv_usec;
+       txc.time.tv_usec = tv->tv_usec;
+       ret = do_adjtimex(&txc);
+       tv->tv_usec = txc.time.tv_usec;
 
-       return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret;
+       return copy_to_user(txc_p, &txc, sizeof(txc)) ? -EFAULT : ret;
 }
 
-SYSCALL_DEFINE2(sparc_clock_adjtime, const clockid_t, which_clock,struct timex __user *, txc_p)
+SYSCALL_DEFINE2(sparc_clock_adjtime, const clockid_t, which_clock,
+               struct __kernel_timex __user *, txc_p)
 {
-       struct timex txc;               /* Local copy of parameter */
-       struct __kernel_timex *kt = (void *)&txc;
+       struct __kernel_timex txc;
+       struct __kernel_old_timeval *tv = (void *)&txc.time;
        int ret;
 
        if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) {
@@ -590,18 +591,18 @@ SYSCALL_DEFINE2(sparc_clock_adjtime, const clockid_t, which_clock,struct timex _
         * structure. But bear in mind that the structures
         * may change
         */
-       if (copy_from_user(&txc, txc_p, sizeof(struct timex)))
+       if (copy_from_user(&txc, txc_p, sizeof(txc)))
                return -EFAULT;
 
        /*
         * override for sparc64 specific timeval type: tv_usec
         * is 32 bit wide instead of 64-bit in __kernel_timex
         */
-       kt->time.tv_usec = txc.time.tv_usec;
-       ret = do_clock_adjtime(which_clock, kt);
-       txc.time.tv_usec = kt->time.tv_usec;
+       txc.time.tv_usec = tv->tv_usec;
+       ret = do_clock_adjtime(which_clock, &txc);
+       tv->tv_usec = txc.time.tv_usec;
 
-       return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret;
+       return copy_to_user(txc_p, &txc, sizeof(txc)) ? -EFAULT : ret;
 }
 
 SYSCALL_DEFINE5(utrap_install, utrap_entry_t, type,