From: Christoph Hellwig Date: Tue, 4 Jun 2019 07:15:22 +0000 (+0200) Subject: x86/fpu: Simplify kernel_fpu_end() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b78ea19ac22fd7b32d7828066cce3d8f2db5226a;p=openwrt%2Fstaging%2Fblogic.git x86/fpu: Simplify kernel_fpu_end() Remove two little helpers and merge them into kernel_fpu_end() to streamline the function. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Acked-by: Sebastian Andrzej Siewior Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Nicolai Stange Cc: Rik van Riel Cc: Thomas Gleixner Cc: x86-ml Link: https://lkml.kernel.org/r/20190604071524.12835-2-hch@lst.de --- diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 649fbc3fcf9f..8e046068d20f 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -49,12 +49,6 @@ static void kernel_fpu_disable(void) this_cpu_write(in_kernel_fpu, true); } -static void kernel_fpu_enable(void) -{ - WARN_ON_FPU(!this_cpu_read(in_kernel_fpu)); - this_cpu_write(in_kernel_fpu, false); -} - static bool kernel_fpu_disabled(void) { return this_cpu_read(in_kernel_fpu); @@ -115,11 +109,6 @@ static void __kernel_fpu_begin(void) __cpu_invalidate_fpregs_state(); } -static void __kernel_fpu_end(void) -{ - kernel_fpu_enable(); -} - void kernel_fpu_begin(void) { preempt_disable(); @@ -129,7 +118,9 @@ EXPORT_SYMBOL_GPL(kernel_fpu_begin); void kernel_fpu_end(void) { - __kernel_fpu_end(); + WARN_ON_FPU(!this_cpu_read(in_kernel_fpu)); + + this_cpu_write(in_kernel_fpu, false); preempt_enable(); } EXPORT_SYMBOL_GPL(kernel_fpu_end);