linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memblock test: include <linux/sizes.h> from tools mm.h stub
@ 2025-12-28 18:39 Mike Rapoport
  2026-01-05  9:33 ` Anshuman Khandual
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Rapoport @ 2025-12-28 18:39 UTC (permalink / raw)
  To: linux-mm; +Cc: Mike Rapoport, linux-kernel

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

memblock test compilation fails:

memblock.c: In function ‘memblock_validate_numa_coverage’:
memblock.c:784:58: error: ‘SZ_1M’ undeclared (first use in this function)
  784 |                 mem_size_mb = memblock_phys_mem_size() / SZ_1M;
      |                                                          ^~~~~

The SZ_1M is defined in sizes.h, but it is not included by stub version of
mm.h in tools/include/linux.

Add include of sizes.h to tools/include/linux/mm.h to fix the compilation
of memblock tests.

Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
 tools/include/linux/mm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
index 677c37e4a18c..028f3faf46e7 100644
--- a/tools/include/linux/mm.h
+++ b/tools/include/linux/mm.h
@@ -4,6 +4,7 @@
 
 #include <linux/align.h>
 #include <linux/mmzone.h>
+#include <linux/sizes.h>
 
 #define PAGE_SHIFT		12
 #define PAGE_SIZE		(_AC(1, UL) << PAGE_SHIFT)
-- 
2.51.0



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

* Re: [PATCH] memblock test: include <linux/sizes.h> from tools mm.h stub
  2025-12-28 18:39 [PATCH] memblock test: include <linux/sizes.h> from tools mm.h stub Mike Rapoport
@ 2026-01-05  9:33 ` Anshuman Khandual
  0 siblings, 0 replies; 2+ messages in thread
From: Anshuman Khandual @ 2026-01-05  9:33 UTC (permalink / raw)
  To: Mike Rapoport, linux-mm; +Cc: linux-kernel

On 29/12/25 12:09 AM, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> 
> memblock test compilation fails:
> 
> memblock.c: In function ‘memblock_validate_numa_coverage’:
> memblock.c:784:58: error: ‘SZ_1M’ undeclared (first use in this function)
>   784 |                 mem_size_mb = memblock_phys_mem_size() / SZ_1M;
>       |                                                          ^~~~~
> 
> The SZ_1M is defined in sizes.h, but it is not included by stub version of
> mm.h in tools/include/linux.
> 
> Add include of sizes.h to tools/include/linux/mm.h to fix the compilation
> of memblock tests.
> 
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
>  tools/include/linux/mm.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
> index 677c37e4a18c..028f3faf46e7 100644
> --- a/tools/include/linux/mm.h
> +++ b/tools/include/linux/mm.h
> @@ -4,6 +4,7 @@
>  
>  #include <linux/align.h>
>  #include <linux/mmzone.h>
> +#include <linux/sizes.h>
>  
>  #define PAGE_SHIFT		12
>  #define PAGE_SIZE		(_AC(1, UL) << PAGE_SHIFT)

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>


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

end of thread, other threads:[~2026-01-05  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-28 18:39 [PATCH] memblock test: include <linux/sizes.h> from tools mm.h stub Mike Rapoport
2026-01-05  9:33 ` Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox