]> www.infradead.org Git - users/jedix/linux-maple.git/commit
include/linux/log2.h: mark is_power_of_2() with __always_inline
authorSu Hui <suhui@nfschina.com>
Fri, 21 Feb 2025 07:16:25 +0000 (15:16 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 00:58:46 +0000 (16:58 -0800)
commit3f387f2ef75e8669648a8dd6768b6f18774d0607
treebdfdf3569b5649ee29a3cc4dbddc4828704901e3
parentded4b48dd1fa75ad6291b8dcaa24aa60e48230af
include/linux/log2.h: mark is_power_of_2() with __always_inline

When building kernel with randconfig, there is an error:

In function `kvm_is_cr4_bit_set',inlined from
`kvm_update_cpuid_runtime' at arch/x86/kvm/cpuid.c:310:9:

include/linux/compiler_types.h:542:38: error: call to
`__compiletime_assert_380' declared with attribute error:
BUILD_BUG_ON failed: !is_power_of_2(cr4_bit).

'!is_power_of_2(X86_CR4_OSXSAVE)' is False, but gcc treats is_power_of_2()
as non-inline function and a compilation error happens. Fix this by marking
is_power_of_2() with __always_inline.

Link: https://lkml.kernel.org/r/20250221071624.1356899-1-suhui@nfschina.com
Signed-off-by: Su Hui <suhui@nfschina.com>
Cc: Binbin Wu <binbin.wu@linux.intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/log2.h