From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756151AbbCNPPr (ORCPT ); Sat, 14 Mar 2015 11:15:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45289 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527AbbCNPPp (ORCPT ); Sat, 14 Mar 2015 11:15:45 -0400 Date: Sat, 14 Mar 2015 16:13:34 +0100 From: Oleg Nesterov To: Borislav Petkov Cc: Dave Hansen , Ingo Molnar , Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: [PATCH 1/1] x86/cpu: kill eager_fpu_init_bp() Message-ID: <20150314151334.GC13029@redhat.com> References: <54F74F59.5070107@intel.com> <20150313182656.GA8249@redhat.com> <20150314111648.GD3114@pd.tnic> <20150314151308.GB13029@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150314151308.GB13029@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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