The patch titled Subject: mm/memremap: mark folio_span_valid() as __maybe_unused has been added to the -mm mm-unstable branch. Its filename is fsdax-introduce-pgmap_request_folios-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fsdax-introduce-pgmap_request_folios-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Nathan Chancellor <nathan@xxxxxxxxxx> Subject: mm/memremap: mark folio_span_valid() as __maybe_unused Date: Tue, 18 Oct 2022 08:26:46 -0700 When building without CONFIG_DEBUG_VM, clang warns: mm/memremap.c:495:13: error: function 'folio_span_valid' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static bool folio_span_valid(struct dev_pagemap *pgmap, struct folio *folio, ^ 1 error generated. folio_span_valid() is only used within a instance of VM_WARN_ON_ONCE(), which evaluates to BUILD_BUG_ON_INVALID() with CONFIG_DEBUG_VM=n, which ultimately resolves to sizeof(), which is fully resolved at compile time. Basically, the warning is flagging that folio_span_valid() is only used in a compile time context and will not be called at run time. Since this is expected given the configuration, mark folio_span_valid() as __maybe_unused so that there is no warning. Link: https://lkml.kernel.org/r/20221018152645.3195108-1-nathan@xxxxxxxxxx Fixes: ("fsdax: introduce pgmap_request_folios()") Link: https://github.com/ClangBuiltLinux/linux/issues/1739 Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Nathan Chancellor <nathan@xxxxxxxxxx> Cc: Tom Rix <trix@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memremap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/mm/memremap.c~fsdax-introduce-pgmap_request_folios-fix +++ a/mm/memremap.c @@ -530,8 +530,9 @@ void zone_device_page_init(struct page * } EXPORT_SYMBOL_GPL(zone_device_page_init); -static bool folio_span_valid(struct dev_pagemap *pgmap, struct folio *folio, - int nr_folios) +static __maybe_unused bool folio_span_valid(struct dev_pagemap *pgmap, + struct folio *folio, + int nr_folios) { unsigned long pfn_start, pfn_end; _ Patches currently in -mm which might be from nathan@xxxxxxxxxx are fsdax-introduce-pgmap_request_folios-fix.patch