Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030416AbbEERwD (ORCPT ); Tue, 5 May 2015 13:52:03 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:38578 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030370AbbEERv7 (ORCPT ); Tue, 5 May 2015 13:51:59 -0400 From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Andy Lutomirski , Borislav Petkov , Dave Hansen , Fenghua Yu , "H. Peter Anvin" , Linus Torvalds , Oleg Nesterov , Thomas Gleixner Subject: [PATCH 080/208] x86/fpu: Rename 'xstate_features' to 'xfeatures_nr' Date: Tue, 5 May 2015 19:49:32 +0200 Message-Id: <1430848300-27877-2-git-send-email-mingo@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430848300-27877-1-git-send-email-mingo@kernel.org> References: <1430848300-27877-1-git-send-email-mingo@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2803 Lines: 73 The name 'xstate_features' does not tell us whether it's a bitmap or any other value. That it's a count of features is only obvious if you read the code that calculates it. Rename it to the more descriptive 'xfeatures_nr' name. Reviewed-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/fpu/xsave.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/fpu/xsave.c b/arch/x86/kernel/fpu/xsave.c index c0e95538d689..1d0e27128f18 100644 --- a/arch/x86/kernel/fpu/xsave.c +++ b/arch/x86/kernel/fpu/xsave.c @@ -25,7 +25,9 @@ struct xsave_struct *init_xstate_buf; static struct _fpx_sw_bytes fx_sw_reserved, fx_sw_reserved_ia32; static unsigned int *xstate_offsets, *xstate_sizes; static unsigned int xstate_comp_offsets[sizeof(xfeatures_mask)*8]; -static unsigned int xstate_features; + +/* The number of supported xfeatures in xfeatures_mask: */ +static unsigned int xfeatures_nr; /* * If a processor implementation discern that a processor state component is @@ -465,9 +467,9 @@ static void __init setup_xstate_features(void) { int eax, ebx, ecx, edx, leaf = 0x2; - xstate_features = fls64(xfeatures_mask); - xstate_offsets = alloc_bootmem(xstate_features * sizeof(int)); - xstate_sizes = alloc_bootmem(xstate_features * sizeof(int)); + xfeatures_nr = fls64(xfeatures_mask); + xstate_offsets = alloc_bootmem(xfeatures_nr * sizeof(int)); + xstate_sizes = alloc_bootmem(xfeatures_nr * sizeof(int)); do { cpuid_count(XSTATE_CPUID, leaf, &eax, &ebx, &ecx, &edx); @@ -528,7 +530,7 @@ void setup_xstate_comp(void) xstate_comp_offsets[1] = offsetof(struct i387_fxsave_struct, xmm_space); if (!cpu_has_xsaves) { - for (i = 2; i < xstate_features; i++) { + for (i = 2; i < xfeatures_nr; i++) { if (test_bit(i, (unsigned long *)&xfeatures_mask)) { xstate_comp_offsets[i] = xstate_offsets[i]; xstate_comp_sizes[i] = xstate_sizes[i]; @@ -539,7 +541,7 @@ void setup_xstate_comp(void) xstate_comp_offsets[2] = FXSAVE_SIZE + XSAVE_HDR_SIZE; - for (i = 2; i < xstate_features; i++) { + for (i = 2; i < xfeatures_nr; i++) { if (test_bit(i, (unsigned long *)&xfeatures_mask)) xstate_comp_sizes[i] = xstate_sizes[i]; else -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/