]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: fix clang build
authorRadim Krčmář <rkrcmar@redhat.com>
Wed, 13 Sep 2017 13:13:46 +0000 (15:13 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 13 Sep 2017 14:40:24 +0000 (16:40 +0200)
commitea3d6ede0e779c1a94fe913f03b455f15bb58fb7
tree249d9f1eeff7461de46d73fa16c18b7e729de166
parent07adb4aad6cef8ea35c9cb16374eb5874638c4f3
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: fbb9ff16df5b ("KVM: x86: generalize guest_cpuid_has_ helpers")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/cpuid.h