From: Simon Horman <horms@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>,
Jeff Layton <jlayton@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
NeilBrown <neilb@suse.de>,
"J. Bruce Fields" <bfields@fieldses.org>,
Arnd Bergmann <arnd@arndb.de>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Yang Erkun <yangerkun@huawei.com>,
linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [RESEND] sunrpc: suppress warnings for unused procfs functions
Date: Thu, 27 Feb 2025 18:07:53 +0000 [thread overview]
Message-ID: <20250227180753.GI1615191@kernel.org> (raw)
In-Reply-To: <20250225145234.1097985-1-arnd@kernel.org>
On Tue, Feb 25, 2025 at 03:52:21PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> There is a warning about unused variables when building with W=1 and no procfs:
>
> net/sunrpc/cache.c:1660:30: error: 'cache_flush_proc_ops' defined but not used [-Werror=unused-const-variable=]
> 1660 | static const struct proc_ops cache_flush_proc_ops = {
> | ^~~~~~~~~~~~~~~~~~~~
> net/sunrpc/cache.c:1622:30: error: 'content_proc_ops' defined but not used [-Werror=unused-const-variable=]
> 1622 | static const struct proc_ops content_proc_ops = {
> | ^~~~~~~~~~~~~~~~
> net/sunrpc/cache.c:1598:30: error: 'cache_channel_proc_ops' defined but not used [-Werror=unused-const-variable=]
> 1598 | static const struct proc_ops cache_channel_proc_ops = {
> | ^~~~~~~~~~~~~~~~~~~~~~
>
> These are used inside of an #ifdef, so replacing that with an
> IS_ENABLED() check lets the compiler see how they are used while
> still dropping them during dead code elimination.
>
> Fixes: dbf847ecb631 ("knfsd: allow cache_register to return error on failure")
> Reviewed-by: Jeff Layton <jlayton@kernel.org>
> Acked-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> This patch from last year is still needed, resending without changes
Tested-by: Simon Horman <horms@kernel.org> # build-tested
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2025-02-27 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 14:52 [PATCH] [RESEND] sunrpc: suppress warnings for unused procfs functions Arnd Bergmann
2025-02-27 18:07 ` Simon Horman [this message]
2025-03-01 17:51 ` cel
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=20250227180753.GI1615191@kernel.org \
--to=horms@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jlayton@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.kernel.org \
--cc=okorniev@redhat.com \
--cc=pabeni@redhat.com \
--cc=tom@talpey.com \
--cc=trondmy@kernel.org \
--cc=yangerkun@huawei.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;
as well as URLs for NNTP newsgroup(s).