* [PATCH] memblock tests: fix unknown macro build error
@ 2025-12-22 7:15 Dmitry Antipov
0 siblings, 0 replies; only message in thread
From: Dmitry Antipov @ 2025-12-22 7:15 UTC (permalink / raw)
To: Mike Rapoport; +Cc: linux-mm, Dmitry Antipov
Running 'make CC=clang' under tools/testing/memblock, I've
noticed the following:
clang -I. -I../../include -Wall -O2 -fsanitize=address -fsanitize=undefined \
-D CONFIG_PHYS_ADDR_T_64BIT -c -o memblock.o memblock.c
memblock.c:783:44: error: use of undeclared identifier 'SZ_1M'
783 | mem_size_mb = memblock_phys_mem_size() / SZ_1M;
| ^~~~~
memblock.c:785:37: error: use of undeclared identifier 'SZ_1M'
785 | (nr_pages << PAGE_SHIFT) / SZ_1M, mem_size_mb);
| ^~~~~
So just include linux/sizes.h from the linux/kernel.h stub.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
tools/testing/memblock/linux/kernel.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/memblock/linux/kernel.h b/tools/testing/memblock/linux/kernel.h
index 4d1012d5be6e..3401ea867c8f 100644
--- a/tools/testing/memblock/linux/kernel.h
+++ b/tools/testing/memblock/linux/kernel.h
@@ -10,5 +10,6 @@
#include <linux/kconfig.h>
#include <linux/string.h>
#include <linux/ctype.h>
+#include <linux/sizes.h>
#endif
--
2.52.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-22 7:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-22 7:15 [PATCH] memblock tests: fix unknown macro build error Dmitry Antipov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox