Merge branches 'fixes', 'misc' and 'spectre' into for-next
[sfrench/cifs-2.6.git] / arch / arm / vfp / vfpmodule.c
index dc7e6b50ef674839a21480c69e12bec144d19194..2b287d0d6bc2d82d36d83041bd2f4fb465f81351 100644 (file)
@@ -553,12 +553,11 @@ void vfp_flush_hwstate(struct thread_info *thread)
  * Save the current VFP state into the provided structures and prepare
  * for entry into a new function (signal handler).
  */
-int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
-                                   struct user_vfp_exc __user *ufp_exc)
+int vfp_preserve_user_clear_hwstate(struct user_vfp *ufp,
+                                   struct user_vfp_exc *ufp_exc)
 {
        struct thread_info *thread = current_thread_info();
        struct vfp_hard_struct *hwstate = &thread->vfpstate.hard;
-       int err = 0;
 
        /* Ensure that the saved hwstate is up-to-date. */
        vfp_sync_hwstate(thread);
@@ -567,22 +566,19 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
         * Copy the floating point registers. There can be unused
         * registers see asm/hwcap.h for details.
         */
-       err |= __copy_to_user(&ufp->fpregs, &hwstate->fpregs,
-                             sizeof(hwstate->fpregs));
+       memcpy(&ufp->fpregs, &hwstate->fpregs, sizeof(hwstate->fpregs));
+
        /*
         * Copy the status and control register.
         */
-       __put_user_error(hwstate->fpscr, &ufp->fpscr, err);
+       ufp->fpscr = hwstate->fpscr;
 
        /*
         * Copy the exception registers.
         */
-       __put_user_error(hwstate->fpexc, &ufp_exc->fpexc, err);
-       __put_user_error(hwstate->fpinst, &ufp_exc->fpinst, err);
-       __put_user_error(hwstate->fpinst2, &ufp_exc->fpinst2, err);
-
-       if (err)
-               return -EFAULT;
+       ufp_exc->fpexc = hwstate->fpexc;
+       ufp_exc->fpinst = hwstate->fpinst;
+       ufp_exc->fpinst2 = ufp_exc->fpinst2;
 
        /* Ensure that VFP is disabled. */
        vfp_flush_hwstate(thread);