All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, paulb@nvidia.com, marcelo.leitner@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net/sched: cls_api: Move call to tcf_exts_miss_cookie_base_destroy()
Date: Sat, 25 Feb 2023 17:08:17 +0100	[thread overview]
Message-ID: <Y/oycX7fMP8yJAdd@corigine.com> (raw)
In-Reply-To: <20230224-cls_api-wunused-function-v1-1-12c77986dc2d@kernel.org>

On Fri, Feb 24, 2023 at 11:18:49AM -0700, Nathan Chancellor wrote:
> When CONFIG_NET_CLS_ACT is disabled:
> 
>   ../net/sched/cls_api.c:141:13: warning: 'tcf_exts_miss_cookie_base_destroy' defined but not used [-Wunused-function]
>     141 | static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts)
>         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Due to the way the code is structured, it is possible for a definition
> of tcf_exts_miss_cookie_base_destroy() to be present without actually
> being used. Its single callsite is in an '#ifdef CONFIG_NET_CLS_ACT'
> block but a definition will always be present in the file. The version
> of tcf_exts_miss_cookie_base_destroy() that actually does something
> depends on CONFIG_NET_TC_SKB_EXT, so the stub function is used in both
> CONFIG_NET_CLS_ACT=n and CONFIG_NET_CLS_ACT=y + CONFIG_NET_TC_SKB_EXT=n
> configurations.
> 
> Move the call to tcf_exts_miss_cookie_base_destroy() in
> tcf_exts_destroy() out of the '#ifdef CONFIG_NET_CLS_ACT', so that it
> always appears used to the compiler, while not changing any behavior
> with any of the various configuration combinations.
> 
> Fixes: 80cd22c35c90 ("net/sched: cls_api: Support hardware miss to tc action")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks Nathan,

I think the #ifdefs in this file could do with some work.
But as a fix this looks good to me.

Reviewed-by: Simon Horman <simon.horman@corigine.com>

  reply	other threads:[~2023-02-25 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 18:18 [PATCH net] net/sched: cls_api: Move call to tcf_exts_miss_cookie_base_destroy() Nathan Chancellor
2023-02-25 16:08 ` Simon Horman [this message]
2023-02-25 21:15   ` Nathan Chancellor
2023-02-26 12:01     ` Simon Horman
2023-02-27 19:25 ` Jakub Kicinski

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=Y/oycX7fMP8yJAdd@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paulb@nvidia.com \
    --cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.