@@ -141,7 +141,7 @@ static inline int copy_fxregs_to_user(struct fxregs_state __user *fx)
141141 return user_insn (rex64 /fxsave (%[fx ]), "=m" (* fx ), [fx ] "R" (fx ));
142142}
143143
144- static inline int copy_kernel_to_fxregs (struct fxregs_state * fx )
144+ static inline void copy_kernel_to_fxregs (struct fxregs_state * fx )
145145{
146146 int err ;
147147
@@ -157,8 +157,6 @@ static inline int copy_kernel_to_fxregs(struct fxregs_state *fx)
157157 }
158158 /* Copying from a kernel buffer to FPU registers should never fail: */
159159 WARN_ON_FPU (err );
160-
161- return err ;
162160}
163161
164162static inline int copy_user_to_fxregs (struct fxregs_state __user * fx )
@@ -173,13 +171,11 @@ static inline int copy_user_to_fxregs(struct fxregs_state __user *fx)
173171 "m" (* fx ));
174172}
175173
176- static inline int copy_kernel_to_fregs (struct fregs_state * fx )
174+ static inline void copy_kernel_to_fregs (struct fregs_state * fx )
177175{
178176 int err = check_insn (frstor %[fx ], "=m" (* fx ), [fx ] "m" (* fx ));
179177
180178 WARN_ON_FPU (err );
181-
182- return err ;
183179}
184180
185181static inline int copy_user_to_fregs (struct fregs_state __user * fx )
@@ -450,20 +446,19 @@ static inline int copy_fpregs_to_fpstate(struct fpu *fpu)
450446 return 0 ;
451447}
452448
453- static inline int __copy_kernel_to_fpregs (struct fpu * fpu )
449+ static inline void __copy_kernel_to_fpregs (struct fpu * fpu )
454450{
455451 if (use_xsave ()) {
456452 copy_kernel_to_xregs (& fpu -> state .xsave , -1 );
457- return 0 ;
458453 } else {
459454 if (use_fxsr ())
460- return copy_kernel_to_fxregs (& fpu -> state .fxsave );
455+ copy_kernel_to_fxregs (& fpu -> state .fxsave );
461456 else
462- return copy_kernel_to_fregs (& fpu -> state .fsave );
457+ copy_kernel_to_fregs (& fpu -> state .fsave );
463458 }
464459}
465460
466- static inline int copy_kernel_to_fpregs (struct fpu * fpu )
461+ static inline void copy_kernel_to_fpregs (struct fpu * fpu )
467462{
468463 /*
469464 * AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is
@@ -478,7 +473,7 @@ static inline int copy_kernel_to_fpregs(struct fpu *fpu)
478473 : : [addr ] "m" (fpu -> fpregs_active ));
479474 }
480475
481- return __copy_kernel_to_fpregs (fpu );
476+ __copy_kernel_to_fpregs (fpu );
482477}
483478
484479extern int copy_fpstate_to_sigframe (void __user * buf , void __user * fp , int size );
@@ -646,12 +641,8 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
646641 */
647642static inline void switch_fpu_finish (struct fpu * new_fpu , fpu_switch_t fpu_switch )
648643{
649- if (fpu_switch .preload ) {
650- if (unlikely (copy_kernel_to_fpregs (new_fpu ))) {
651- WARN_ON_FPU (1 );
652- fpu__clear (new_fpu );
653- }
654- }
644+ if (fpu_switch .preload )
645+ copy_kernel_to_fpregs (new_fpu );
655646}
656647
657648/*
0 commit comments