linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: mm: Fix build error
@ 2020-09-27  9:26 Pujin Shi
  2020-09-27 20:22 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Pujin Shi @ 2020-09-27  9:26 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Mike Rapoport, Andrew Morton, Paul Burton, Alexey Malahov,
	Kees Cook, Serge Semin, linux-mips, linux-kernel, shipujin.t

arch/mips/mm/init.c: In function 'mem_init':
././include/linux/compiler_types.h:319:38: error: call to '__compiletime_assert_321' declared with attribute error: BUILD_BUG_ON failed: IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT)
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                                      ^
././include/linux/compiler_types.h:300:4: note: in definition of macro '__compiletime_assert'
    prefix ## suffix();    \
    ^
././include/linux/compiler_types.h:319:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
  ^
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
./include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
arch/mips/mm/init.c:458:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT));
  ^

Signed-off-by: Pujin Shi <shipujin.t@gmail.com>
---
 arch/mips/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 6c7bbfe35ba3..71dfdf1cb88a 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -455,7 +455,7 @@ 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));
+	WARN_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT));
 
 #ifdef CONFIG_HIGHMEM
 #ifdef CONFIG_DISCONTIGMEM
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: mm: Fix build error
  2020-09-27  9:26 [PATCH] MIPS: mm: Fix build error Pujin Shi
@ 2020-09-27 20:22 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2020-09-27 20:22 UTC (permalink / raw)
  To: Pujin Shi
  Cc: Mike Rapoport, Andrew Morton, Paul Burton, Alexey Malahov,
	Kees Cook, Serge Semin, linux-mips, linux-kernel

On Sun, Sep 27, 2020 at 05:26:10PM +0800, Pujin Shi wrote:
> arch/mips/mm/init.c: In function 'mem_init':
> ././include/linux/compiler_types.h:319:38: error: call to '__compiletime_assert_321' declared with attribute error: BUILD_BUG_ON failed: IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT)
>   _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)

this is exactly what we want, so there is nothing to fix in this spot.
The only real fix is change page table format for 32bit to get more
PTE bits...

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-27 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27  9:26 [PATCH] MIPS: mm: Fix build error Pujin Shi
2020-09-27 20:22 ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).