netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 v1 1/1] netfilter: conntrack: Guard possoble unused functions
Date: Fri, 6 Sep 2024 17:29:38 +0100	[thread overview]
Message-ID: <20240906162938.GH2097826@kernel.org> (raw)
In-Reply-To: <20240905203612.333421-1-andriy.shevchenko@linux.intel.com>

On Thu, Sep 05, 2024 at 11:36:12PM +0300, Andy Shevchenko wrote:
> Some of the functions may be unused, 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)
>       |                      ^~~~~~~~~~~~~~~~~~~~~~~~

Hi Andy,

Local testing seems to show that the warning is still emitted
for ctnetlink_label_size if CONFIG_NETFILTER_NETLINK_GLUE_CT is enabled
but CONFIG_NF_CONNTRACK_EVENTS is not.

> 
> 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").
> 
> Fixes: 4a96300cec88 ("netfilter: ctnetlink: restore inlining for netlink message size calculation")

I'm not sure that this qualifies as a fix, rather I think it should
be targeted at net-next without a Fixes tag.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

...

  reply	other threads:[~2024-09-06 16:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 20:36 [PATCH net v1 1/1] netfilter: conntrack: Guard possoble unused functions Andy Shevchenko
2024-09-06 16:29 ` Simon Horman [this message]
2024-09-06 16:31   ` Simon Horman
2024-09-09  9:26   ` Andy Shevchenko
2024-09-09  9:37   ` Andy Shevchenko
2024-09-09 15:17     ` Simon Horman
2024-09-09 15:36       ` Andy Shevchenko
2024-09-09 18:30         ` Simon Horman
2024-09-10  8:12           ` Andy Shevchenko
2024-09-10  9:45             ` Simon Horman
2024-09-16 15:17               ` Simon Horman

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=20240906162938.GH2097826@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).