From: Simon Horman <horms@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Felix Huettner <felix.huettner@mail.schwarz>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, Jozsef Kadlecsik <kadlec@netfilter.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>
Subject: Re: [PATCH net-next v3 1/1] netfilter: conntrack: Guard possible unused functions
Date: Tue, 10 Sep 2024 14:21:01 +0100 [thread overview]
Message-ID: <20240910132101.GC572255@kernel.org> (raw)
In-Reply-To: <20240910083640.1485541-1-andriy.shevchenko@linux.intel.com>
On Tue, Sep 10, 2024 at 11:35:33AM +0300, Andy Shevchenko wrote:
> Some of the functions may be unused (CONFIG_NETFILTER_NETLINK_GLUE_CT=n
> and CONFIG_NF_CONNTRACK_EVENTS=n), it prevents kernel builds with clang,
> `make W=1` and CONFIG_WERROR=y:
>
> net/netfilter/nf_conntrack_netlink.c:657:22: error: unused function 'ctnetlink_acct_size' [-Werror,-Wunused-function]
> 657 | static inline size_t ctnetlink_acct_size(const struct nf_conn *ct)
> | ^~~~~~~~~~~~~~~~~~~
> net/netfilter/nf_conntrack_netlink.c:667:19: error: unused function 'ctnetlink_secctx_size' [-Werror,-Wunused-function]
> 667 | static inline int ctnetlink_secctx_size(const struct nf_conn *ct)
> | ^~~~~~~~~~~~~~~~~~~~~
> net/netfilter/nf_conntrack_netlink.c:683:22: error: unused function 'ctnetlink_timestamp_size' [-Werror,-Wunused-function]
> 683 | static inline size_t ctnetlink_timestamp_size(const struct nf_conn *ct)
> | ^~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix this by guarding possible unused functions with ifdeffery.
>
> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> inline functions for W=1 build").
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>
> v3: explicitly mentioned the configuration options that lead to issue (Simon)
> v2: fixed typo, dropped Fixes (Simon), optimised by reusing existing ifdeffery
Thanks for the updates.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-09-10 13:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 8:35 [PATCH net-next v3 1/1] netfilter: conntrack: Guard possible unused functions Andy Shevchenko
2024-09-10 13:21 ` Simon Horman [this message]
2024-09-15 21:14 ` Pablo Neira Ayuso
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=20240910132101.GC572255@kernel.org \
--to=horms@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=felix.huettner@mail.schwarz \
--cc=justinstitt@google.com \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
/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).