linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent
@ 2020-12-30 15:40 Arnd Bergmann
  2021-01-04 11:34 ` Vlastimil Babka
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Arnd Bergmann @ 2020-12-30 15:40 UTC (permalink / raw)
  To: Andrew Morton, Nathan Chancellor, Nick Desaulniers,
	Kirill A. Shutemov, Wei Yang
  Cc: Arnd Bergmann, Vlastimil Babka, Dmitry Safonov, Brian Geffon,
	linux-mm, linux-kernel, clang-built-linux

From: Arnd Bergmann <arnd@arndb.de>

clang cannt evaluate this function argument at compile time
when the function is not inlined, which leads to a link
time failure:

ld.lld: error: undefined symbol: __compiletime_assert_414
>>> referenced by mremap.c
>>>               mremap.o:(get_extent) in archive mm/built-in.a

Mark the function as __always_inline to avoid it.

Fixes: 9ad9718bfa41 ("mm/mremap: calculate extent in one place")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 mm/mremap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/mremap.c b/mm/mremap.c
index c5590afe7165..1cb464a07184 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -336,8 +336,9 @@ enum pgt_entry {
  * valid. Else returns a smaller extent bounded by the end of the source and
  * destination pgt_entry.
  */
-static unsigned long get_extent(enum pgt_entry entry, unsigned long old_addr,
-			unsigned long old_end, unsigned long new_addr)
+static __always_inline unsigned long get_extent(enum pgt_entry entry,
+			unsigned long old_addr, unsigned long old_end,
+			unsigned long new_addr)
 {
 	unsigned long next, extent, mask, size;
 
-- 
2.29.2


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

end of thread, other threads:[~2021-02-05 21:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 15:40 [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent Arnd Bergmann
2021-01-04 11:34 ` Vlastimil Babka
2021-01-04 22:36 ` Nathan Chancellor
2021-01-05 10:28   ` Arnd Bergmann
2021-01-12 19:16 ` Nathan Chancellor
2021-01-12 20:19   ` Sedat Dilek
2021-02-03 18:48   ` Nathan Chancellor
2021-02-03 20:03     ` Kees Cook
2021-02-05 19:00       ` Nathan Chancellor
2021-02-05 21:02         ` Andrew Morton
2021-02-05 21:27           ` Nathan Chancellor
2021-02-05 18:33 ` Nick Desaulniers

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).