From: Dmitry Antipov <dmantipov@yandex.ru>
To: Mike Rapoport <rppt@kernel.org>
Cc: linux-mm@kvack.org, Dmitry Antipov <dmantipov@yandex.ru>
Subject: [PATCH] memblock tests: fix unknown macro build error
Date: Mon, 22 Dec 2025 10:15:43 +0300 [thread overview]
Message-ID: <20251222071543.953823-1-dmantipov@yandex.ru> (raw)
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
reply other threads:[~2025-12-22 7:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251222071543.953823-1-dmantipov@yandex.ru \
--to=dmantipov@yandex.ru \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox