Skip to content

Commit 158e2ee

Browse files
yyu-intel-comsuryasaimadhu
authored andcommitted
x86/fpu/xstate: Make xfeature_is_supervisor()/xfeature_is_user() return bool
Have both xfeature_is_supervisor()/xfeature_is_user() return bool because they are used only in boolean context. Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Yu-cheng Yu <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Sebastian Andrzej Siewior <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: "Ravi V. Shankar" <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Tony Luck <[email protected]> Cc: x86-ml <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8c9e607 commit 158e2ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/kernel/fpu/xstate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int cpu_has_xfeatures(u64 xfeatures_needed, const char **feature_name)
107107
}
108108
EXPORT_SYMBOL_GPL(cpu_has_xfeatures);
109109

110-
static int xfeature_is_supervisor(int xfeature_nr)
110+
static bool xfeature_is_supervisor(int xfeature_nr)
111111
{
112112
/*
113113
* Extended State Enumeration Sub-leaves (EAX = 0DH, ECX = n, n > 1)
@@ -117,10 +117,10 @@ static int xfeature_is_supervisor(int xfeature_nr)
117117
u32 eax, ebx, ecx, edx;
118118

119119
cpuid_count(XSTATE_CPUID, xfeature_nr, &eax, &ebx, &ecx, &edx);
120-
return !!(ecx & 1);
120+
return ecx & 1;
121121
}
122122

123-
static int xfeature_is_user(int xfeature_nr)
123+
static bool xfeature_is_user(int xfeature_nr)
124124
{
125125
return !xfeature_is_supervisor(xfeature_nr);
126126
}

0 commit comments

Comments
 (0)