linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: change vma_alloc_folio_noprof() macro to inline function
@ 2026-02-16 12:17 Arnd Bergmann
  2026-02-16 15:08 ` Lorenzo Stoakes
  2026-02-16 16:58 ` Zi Yan
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2026-02-16 12:17 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand, Vlastimil Babka
  Cc: Arnd Bergmann, Lorenzo Stoakes, Liam R. Howlett, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Brendan Jackman,
	Johannes Weiner, Zi Yan, Alexei Starovoitov, Shakeel Butt,
	Kefeng Wang, Joshua Hahn, linux-mm, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

In a few rare configurations with extra warnings eanbled, the new
drm_pagemap_migrate_populate_ram_pfn() calls vma_alloc_folio_noprof()
but that does not use all the arguments, leading to a harmless warning:

drivers/gpu/drm/drm_pagemap.c: In function 'drm_pagemap_migrate_populate_ram_pfn':
drivers/gpu/drm/drm_pagemap.c:701:63: error: parameter 'addr' set but not used [-Werror=unused-but-set-parameter=]
  701 |                                                 unsigned long addr)
      |                                                 ~~~~~~~~~~~~~~^~~~

Replace the macro with an inline function so the compiler can see
how the argument would be used, but is still able to optimize out
the assignments.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/gfp.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 6ecf6dda93e0..23240208a91f 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -335,8 +335,11 @@ static inline struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int orde
 {
 	return folio_alloc_noprof(gfp, order);
 }
-#define vma_alloc_folio_noprof(gfp, order, vma, addr)		\
-	folio_alloc_noprof(gfp, order)
+static inline struct folio *vma_alloc_folio_noprof(gfp_t gfp, int order,
+		struct vm_area_struct *vma, unsigned long addr)
+{
+	return folio_alloc_noprof(gfp, order);
+}
 #endif
 
 #define alloc_pages(...)			alloc_hooks(alloc_pages_noprof(__VA_ARGS__))
-- 
2.39.5



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

end of thread, other threads:[~2026-02-16 19:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-16 12:17 [PATCH] mm: change vma_alloc_folio_noprof() macro to inline function Arnd Bergmann
2026-02-16 15:08 ` Lorenzo Stoakes
2026-02-16 16:58 ` Zi Yan
2026-02-16 19:24   ` Suren Baghdasaryan

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