* the read-only case, it's not strictly necessary for
* read-only access to the context.
*/
-static int fpu__unlazy_stopped(struct fpu *child_fpu)
+static void fpu__unlazy_stopped(struct fpu *child_fpu)
{
- int ret;
-
- if (WARN_ON_ONCE(child_fpu == ¤t->thread.fpu))
- return -EINVAL;
+ WARN_ON_ONCE(child_fpu == ¤t->thread.fpu);
if (child_fpu->fpstate_active) {
child_fpu->last_cpu = -1;
- return 0;
- }
-
- fpstate_init(child_fpu);
-
- /* Safe to do for stopped child tasks: */
- child_fpu->fpstate_active = 1;
+ } else {
+ fpstate_init(child_fpu);
- return 0;
+ /* Safe to do for stopped child tasks: */
+ child_fpu->fpstate_active = 1;
+ }
}
/*
void *kbuf, void __user *ubuf)
{
struct fpu *fpu = &target->thread.fpu;
- int ret;
if (!cpu_has_fxsr)
return -ENODEV;
- ret = fpu__unlazy_stopped(fpu);
- if (ret)
- return ret;
-
+ fpu__unlazy_stopped(fpu);
sanitize_i387_state(target);
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
if (!cpu_has_fxsr)
return -ENODEV;
- ret = fpu__unlazy_stopped(fpu);
- if (ret)
- return ret;
-
+ fpu__unlazy_stopped(fpu);
sanitize_i387_state(target);
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
if (!cpu_has_xsave)
return -ENODEV;
- ret = fpu__unlazy_stopped(fpu);
- if (ret)
- return ret;
+ fpu__unlazy_stopped(fpu);
xsave = &fpu->state.xsave;
if (!cpu_has_xsave)
return -ENODEV;
- ret = fpu__unlazy_stopped(fpu);
- if (ret)
- return ret;
+ fpu__unlazy_stopped(fpu);
xsave = &fpu->state.xsave;
{
struct fpu *fpu = &target->thread.fpu;
struct user_i387_ia32_struct env;
- int ret;
- ret = fpu__unlazy_stopped(fpu);
- if (ret)
- return ret;
+ fpu__unlazy_stopped(fpu);
if (!static_cpu_has(X86_FEATURE_FPU))
return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
struct user_i387_ia32_struct env;
int ret;
- ret = fpu__unlazy_stopped(fpu);
- if (ret)
- return ret;
+ fpu__unlazy_stopped(fpu);
sanitize_i387_state(target);