From: Radim Krčmář Date: Wed, 13 Sep 2017 13:13:46 +0000 (+0200) Subject: KVM: x86: fix clang build X-Git-Tag: v4.14-rc1~10^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5153723388c8691b886eb9ad28dde92c01f9b191;p=platform%2Fkernel%2Flinux-exynos.git KVM: x86: fix clang build Clang resolves __builtin_constant_p() to false even if the expression is constant in the end. The only purpose of that expression was to differentiate a case where the following expression couldn't be checked at compile-time, so we can just remove the check. Clang handles the following two correctly. Turn it into BUG_ON if there are any more problems with this. Fixes: d6321d493319 ("KVM: x86: generalize guest_cpuid_has_ helpers") Reported-by: Dmitry Vyukov Reviewed-by: David Hildenbrand Signed-off-by: Radim Krčmář --- diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index 1ea3c0e..0bc5c13 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h @@ -59,7 +59,6 @@ static __always_inline struct cpuid_reg x86_feature_cpuid(unsigned x86_feature) { unsigned x86_leaf = x86_feature / 32; - BUILD_BUG_ON(!__builtin_constant_p(x86_leaf)); BUILD_BUG_ON(x86_leaf >= ARRAY_SIZE(reverse_cpuid)); BUILD_BUG_ON(reverse_cpuid[x86_leaf].function == 0);