From: Dan Williams <dan.j.williams@intel.com>
To: Nathan Chancellor <nathan@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Dan Williams <dan.j.williams@intel.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>,
<patches@lists.linux.dev>, Nathan Chancellor <nathan@kernel.org>
Subject: RE: [PATCH] mm/memremap: Mark folio_span_valid() as __maybe_unused
Date: Tue, 18 Oct 2022 10:54:58 -0700 [thread overview]
Message-ID: <634ee87229a37_6be129430@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20221018152645.3195108-1-nathan@kernel.org>
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@kernel.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?
next prev parent reply other threads:[~2022-10-18 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 15:26 Nathan Chancellor
2022-10-18 17:54 ` Dan Williams [this message]
2022-10-18 20:55 ` Andrew Morton
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=634ee87229a37_6be129430@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=patches@lists.linux.dev \
--cc=trix@redhat.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