From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Vlastimil Babka <vbabka@suse.cz>, Arnd Bergmann <arnd@arndb.de>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <jackmanb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
Alexei Starovoitov <ast@kernel.org>,
Shakeel Butt <shakeel.butt@linux.dev>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: change vma_alloc_folio_noprof() macro to inline function
Date: Mon, 16 Feb 2026 15:08:39 +0000 [thread overview]
Message-ID: <866d4c1f-13a5-42f2-8492-29fc5310323a@lucifer.local> (raw)
In-Reply-To: <20260216121751.2378374-1-arnd@kernel.org>
On Mon, Feb 16, 2026 at 01:17:44PM +0100, Arnd Bergmann wrote:
> 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>
It'd be good if we could find a way to avoid these horrible _noprof things, but
I guess that ship's sailed for now...
Anyway, LGTM, so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
> 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
>
Cheers, Lorenzo
next prev parent reply other threads:[~2026-02-16 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 12:17 Arnd Bergmann
2026-02-16 15:08 ` Lorenzo Stoakes [this message]
2026-02-16 16:58 ` Zi Yan
2026-02-16 19:24 ` Suren Baghdasaryan
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=866d4c1f-13a5-42f2-8492-29fc5310323a@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=ast@kernel.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--cc=wangkefeng.wang@huawei.com \
--cc=ziy@nvidia.com \
/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