[PATCH 1/1] x86/cpu: kill eager_fpu_init_bp()

From: Oleg Nesterov
Date: Sat Mar 14 2015 - 11:15:51 EST


Now that eager_fpu_init_bp() does setup_init_fpu_buf() and nothing else
we can remove it and move this code into its "caller", eager_fpu_init().

This avoids the confusing games with "static __refdata void (*boot_func)".
init_xstate_buf can be NULL only on boot, so it is safe to the "__init"
setup_init_fpu_buf() function, just we need to add the "__init_refok"
marker.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---
arch/x86/kernel/xsave.c | 16 +++-------------
1 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 1cf5667..f7e8e0c 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -677,16 +677,8 @@ void xsave_init(void)
this_func();
}

-static inline void __init eager_fpu_init_bp(void)
+void __init_refok eager_fpu_init(void)
{
- if (!init_xstate_buf)
- setup_init_fpu_buf();
-}
-
-void eager_fpu_init(void)
-{
- static __refdata void (*boot_func)(void) = eager_fpu_init_bp;
-
WARN_ON(used_math());
current_thread_info()->status = 0;

@@ -698,10 +690,8 @@ void eager_fpu_init(void)
return;
}

- if (boot_func) {
- boot_func();
- boot_func = NULL;
- }
+ if (!init_xstate_buf)
+ setup_init_fpu_buf();
}

/*
--
1.5.5.1


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