[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <634ee87229a37_6be129430@dwillia2-xfh.jf.intel.com.notmuch>
Date: Tue, 18 Oct 2022 10:54:58 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Nathan Chancellor <nathan@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>
CC: Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>,
<patches@...ts.linux.dev>, Nathan Chancellor <nathan@...nel.org>
Subject: RE: [PATCH] mm/memremap: Mark folio_span_valid() as __maybe_unused
Nathan Chancellor wrote:
> 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.
>
> Fixes: 07108d5bfeeb ("fsdax: introduce pgmap_request_folios()")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1739
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
> ---
>
> I am aware the Fixes SHA is probably not stable but I figured I would
> include it anyways.
This fix looks good to me, but I assume commit-ids are not stable until
the patch moves from mm-unstable to mm-stable. Andrew, do I have that
right?
Powered by blists - more mailing lists