Subject: Re: [PATCH net-next v2 5/6] sfc: add code to register and unregister encap matches

From: Martin Habets <[email-masked]>
Date: Fri, 24 Mar 2023 09:10:41 +0000

On Thu, Mar 23, 2023 at 10:05:30PM -0700, Jakub Kicinski wrote:
> On Thu, 23 Mar 2023 20:45:13 +0000 [email-masked] wrote:
> > +__always_unused
> > +static int efx_tc_flower_record_encap_match(struct efx_nic *efx,
> > +					    struct efx_tc_match *match,
> > +					    enum efx_encap_type type,
> > +					    struct netlink_ext_ack *extack)
> > +{
> > +	struct efx_tc_encap_match *encap, *old;
> > +	bool ipv6;
> > +	int rc;
> 
> clang sayeth 
> 
> drivers/net/ethernet/sfc/tc.c:414:43: warning: variable 'ipv6' is uninitialized when used here [-Wuninitialized]
>         rc = efx_mae_check_encap_match_caps(efx, ipv6, extack);
>                                                  ^~~~
> drivers/net/ethernet/sfc/tc.c:356:11: note: initialize the variable 'ipv6' to silence this warning
>         bool ipv6;
>                  ^
>                   = 0

If CONFIG_IPV6 is unset it is never used, to is needs a __maybe_unused
as well.

Martin