Move fpu_copy() where its only user is.

Beyond readability this also speeds up compilation, as fpu-internal.h
is included in over a dozen .c files.

Reviewed-by: Borislav Petkov <b...@alien8.de>
Cc: Andy Lutomirski <l...@amacapital.net>
Cc: Dave Hansen <dave.han...@linux.intel.com>
Cc: Fenghua Yu <fenghua...@intel.com>
Cc: H. Peter Anvin <h...@zytor.com>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Oleg Nesterov <o...@redhat.com>
Cc: Thomas Gleixner <t...@linutronix.de>
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 arch/x86/include/asm/fpu-internal.h | 14 --------------
 arch/x86/kernel/fpu/core.c          | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/fpu-internal.h 
b/arch/x86/include/asm/fpu-internal.h
index 1e2b6c67b1f1..e180fb96dd0d 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -565,20 +565,6 @@ extern int fpstate_alloc(struct fpu *fpu);
 extern void fpstate_free(struct fpu *fpu);
 extern int fpu__copy(struct task_struct *dst, struct task_struct *src);
 
-static inline void fpu_copy(struct task_struct *dst, struct task_struct *src)
-{
-       if (use_eager_fpu()) {
-               memset(&dst->thread.fpu.state->xsave, 0, xstate_size);
-               __save_fpu(dst);
-       } else {
-               struct fpu *dfpu = &dst->thread.fpu;
-               struct fpu *sfpu = &src->thread.fpu;
-
-               fpu__save(src);
-               memcpy(dfpu->state, sfpu->state, xstate_size);
-       }
-}
-
 static inline unsigned long
 alloc_mathframe(unsigned long sp, int ia32_frame, unsigned long *buf_fx,
                unsigned long *size)
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index c99c79af48d2..3f3c79c75e37 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -203,6 +203,20 @@ void fpstate_free(struct fpu *fpu)
 }
 EXPORT_SYMBOL_GPL(fpstate_free);
 
+static void fpu_copy(struct task_struct *dst, struct task_struct *src)
+{
+       if (use_eager_fpu()) {
+               memset(&dst->thread.fpu.state->xsave, 0, xstate_size);
+               __save_fpu(dst);
+       } else {
+               struct fpu *dfpu = &dst->thread.fpu;
+               struct fpu *sfpu = &src->thread.fpu;
+
+               fpu__save(src);
+               memcpy(dfpu->state, sfpu->state, xstate_size);
+       }
+}
+
 int fpu__copy(struct task_struct *dst, struct task_struct *src)
 {
        dst->thread.fpu.counter = 0;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to