From: luyun <luyun@xxxxxxxxxx> The below error is reported when CONFIG_XPA=n: arch/mips/mm/init.c: In function "mem_init": ././include/linux/compiler_types.h:352:38: error: call to "__compiletime_assert_289" declared with attribute error: BUILD_BUG_ON failed: IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT) ... arch/mips/mm/init.c:454:2: note: in expansion of macro "BUILD_BUG_ON" 454 | BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT)); | ^~~~~~~~~~~~ The macro _PFN_SHIFT is defined as (PAGE_SHIFT - 12 + _CACHE_SHIFT + 3) when CONFIG_CPU_R3K_TLB=n, and _CACHE_SHIFT is conditionally defined with CONFIG_XPA=y. Also _PFN_SHIFT is just equal to PAGE_SHIFT when CONFIG_CPU_R3K_TLB=y, there is no need to judge on this condition. So fix it by adding IS_ENABLED(CONFIG_XPA). Fixes: 05d013a0366d ("MIPS: Detect bad _PFN_SHIFT values") Reported-by: k2ci <kernel-bot@xxxxxxxxxx> Signed-off-by: Yun Lu <luyun@xxxxxxxxxx> --- arch/mips/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 5a8002839550..f13cd2844fed 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -451,7 +451,8 @@ void __init mem_init(void) * When _PFN_SHIFT is greater than PAGE_SHIFT we won't have enough PTE * bits to hold a full 32b physical address on MIPS32 systems. */ - BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT)); + BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && IS_ENABLED(CONFIG_XPA) && + (_PFN_SHIFT > PAGE_SHIFT)); #ifdef CONFIG_HIGHMEM max_mapnr = highend_pfn ? highend_pfn : max_low_pfn; -- 2.25.1 No virus found Checked by Hillstone Network AntiVirus