Skip to content

Commit eb95493

Browse files
arndbakpm00
authored andcommitted
mm: change vma_alloc_folio_noprof() macro to inline function
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. Link: https://lkml.kernel.org/r/20260216121751.2378374-1-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Acked-by: Zi Yan <ziy@nvidia.com> Reviewed-by: Suren Baghdasaryan <surenb@google.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Brendan Jackman <jackmanb@google.com> Cc: David Hildenbrand <david@kernel.org> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Joshua Hahn <joshua.hahnjy@gmail.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Shakeel Butt <shakeel.butt@linux.dev> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 09833d9 commit eb95493

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

include/linux/gfp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,11 @@ static inline struct folio *folio_alloc_mpol_noprof(gfp_t gfp, unsigned int orde
339339
{
340340
return folio_alloc_noprof(gfp, order);
341341
}
342-
#define vma_alloc_folio_noprof(gfp, order, vma, addr) \
343-
folio_alloc_noprof(gfp, order)
342+
static inline struct folio *vma_alloc_folio_noprof(gfp_t gfp, int order,
343+
struct vm_area_struct *vma, unsigned long addr)
344+
{
345+
return folio_alloc_noprof(gfp, order);
346+
}
344347
#endif
345348

346349
#define alloc_pages(...) alloc_hooks(alloc_pages_noprof(__VA_ARGS__))

0 commit comments

Comments
 (0)