x86/fpu: Simplify fpu__save()
authorIngo Molnar <mingo@kernel.org>
Mon, 27 Apr 2015 07:38:21 +0000 (09:38 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:53 +0000 (15:47 +0200)
Factor out a common call.

Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/fpu/core.c

index 00408149de40c236c621876d5c9b248fad73d6b5..a0b2221b686d23ad7376fefc430d996c525d3713 100644 (file)
@@ -180,12 +180,9 @@ void fpu__save(struct fpu *fpu)
 
        preempt_disable();
        if (fpu->fpregs_active) {
-               if (use_eager_fpu()) {
-                       copy_fpregs_to_fpstate(fpu);
-               } else {
-                       copy_fpregs_to_fpstate(fpu);
+               copy_fpregs_to_fpstate(fpu);
+               if (!use_eager_fpu())
                        fpregs_deactivate(fpu);
-               }
        }
        preempt_enable();
 }