[PATCH] asm-generic: bitsperlong: Remove the disabled BITS_PER_LONG check
From: Fang Xieyan
Date: Sat Nov 21 2026 - 09:05:01 EST
A FIXME in this header asks to fix x86-64 and reenable the check
between BITS_PER_LONG and __BITS_PER_LONG. However, this check
cannot be enabled because the two values can legitimately differ
when building the compat vDSO.
BITS_PER_LONG is derived from CONFIG_64BIT and reflects the
kernel's configured word size, while __BITS_PER_LONG reflects
the compiler target ABI.
The existing sanity checks validate __BITS_PER_LONG against the
actual C type 'long'. For regular kernel builds, this also detects
mismatches between BITS_PER_LONG and __BITS_PER_LONG, since
BITS_PER_LONG matches the kernel's native word size.
Remove the dead check and the misleading FIXME.
Signed-off-by: Fang Xieyan <fangxy@xxxxxxxxxxxx>
---
The preprocessed output of this header is unchanged in 64-bit, 32-bit
and compat vDSO (-m32 with CONFIG_64BIT) builds. Build-tested on x86_64
defconfig (IA32_EMULATION=y), including the vdso32 build.
include/asm-generic/bitsperlong.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/include/asm-generic/bitsperlong.h b/include/asm-generic/bitsperlong.h
index 90e8aeebfd2f..5183b50d3080 100644
--- a/include/asm-generic/bitsperlong.h
+++ b/include/asm-generic/bitsperlong.h
@@ -11,14 +11,6 @@
#define BITS_PER_LONG 32
#endif /* CONFIG_64BIT */
-/*
- * FIXME: The check currently breaks x86-64 build, so it's
- * temporarily disabled. Please fix x86-64 and reenable
- */
-#if 0 && BITS_PER_LONG != __BITS_PER_LONG
-#error Inconsistent word size. Check asm/bitsperlong.h
-#endif
-
#if __CHAR_BIT__ * __SIZEOF_LONG__ != __BITS_PER_LONG
#error Inconsistent word size. Check asm/bitsperlong.h
#endif
--
2.50.1