All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fpu_clone function is changed to return type void
@ 2022-06-09  5:23 Li kunyu
  0 siblings, 0 replies; only message in thread
From: Li kunyu @ 2022-06-09  5:23 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, x86, hpa; +Cc: luto, linux-kernel, Li kunyu

It is used to reduce the number of eax calls, improve the execution
efficiency, and use the same return type as fpu__drop and other
functions.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 arch/x86/include/asm/fpu/sched.h | 2 +-
 arch/x86/kernel/fpu/core.c       | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/fpu/sched.h b/arch/x86/include/asm/fpu/sched.h
index b2486b2cbc6e..ca29fd8550ed 100644
--- a/arch/x86/include/asm/fpu/sched.h
+++ b/arch/x86/include/asm/fpu/sched.h
@@ -11,7 +11,7 @@
 
 extern void save_fpregs_to_fpstate(struct fpu *fpu);
 extern void fpu__drop(struct fpu *fpu);
-extern int  fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal);
+extern void  fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal);
 extern void fpu_flush_thread(void);
 
 /*
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 0531d6a06df5..416dcdba992a 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -556,7 +556,7 @@ static inline void fpu_inherit_perms(struct fpu *dst_fpu)
 }
 
 /* Clone current's FPU state on fork */
-int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
+void fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
 {
 	struct fpu *src_fpu = &current->thread.fpu;
 	struct fpu *dst_fpu = &dst->thread.fpu;
@@ -567,7 +567,7 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
 	fpstate_reset(dst_fpu);
 
 	if (!cpu_feature_enabled(X86_FEATURE_FPU))
-		return 0;
+		return;
 
 	/*
 	 * Enforce reload for user space tasks and prevent kernel threads
@@ -583,7 +583,7 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
 		/* Clear out the minimal state */
 		memcpy(&dst_fpu->fpstate->regs, &init_fpstate.regs,
 		       init_fpstate_copy_size());
-		return 0;
+		return;
 	}
 
 	/*
@@ -618,8 +618,6 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
 
 	trace_x86_fpu_copy_src(src_fpu);
 	trace_x86_fpu_copy_dst(dst_fpu);
-
-	return 0;
 }
 
 /*
-- 
2.18.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-09  5:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09  5:23 [PATCH] x86: fpu_clone function is changed to return type void Li kunyu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.