Commit 158e2ee6 authored by Yu-cheng Yu's avatar Yu-cheng Yu Committed by Borislav Petkov

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: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarYu-cheng Yu <yu-cheng.yu@intel.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20191212210855.19260-3-yu-cheng.yu@intel.com
parent 8c9e6073
...@@ -107,7 +107,7 @@ int cpu_has_xfeatures(u64 xfeatures_needed, const char **feature_name) ...@@ -107,7 +107,7 @@ int cpu_has_xfeatures(u64 xfeatures_needed, const char **feature_name)
} }
EXPORT_SYMBOL_GPL(cpu_has_xfeatures); EXPORT_SYMBOL_GPL(cpu_has_xfeatures);
static int xfeature_is_supervisor(int xfeature_nr) static bool xfeature_is_supervisor(int xfeature_nr)
{ {
/* /*
* Extended State Enumeration Sub-leaves (EAX = 0DH, ECX = n, n > 1) * Extended State Enumeration Sub-leaves (EAX = 0DH, ECX = n, n > 1)
...@@ -117,10 +117,10 @@ static int xfeature_is_supervisor(int xfeature_nr) ...@@ -117,10 +117,10 @@ static int xfeature_is_supervisor(int xfeature_nr)
u32 eax, ebx, ecx, edx; u32 eax, ebx, ecx, edx;
cpuid_count(XSTATE_CPUID, xfeature_nr, &eax, &ebx, &ecx, &edx); cpuid_count(XSTATE_CPUID, xfeature_nr, &eax, &ebx, &ecx, &edx);
return !!(ecx & 1); return ecx & 1;
} }
static int xfeature_is_user(int xfeature_nr) static bool xfeature_is_user(int xfeature_nr)
{ {
return !xfeature_is_supervisor(xfeature_nr); return !xfeature_is_supervisor(xfeature_nr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment