[PATCH] net: tsec: mark tsec_set_promisc() as __maybe_unused

Ramon Fried rfried.dev at gmail.com
Wed Nov 3 07:57:45 CET 2021


On Sun, Oct 31, 2021 at 11:52 PM Vladimir Oltean
<vladimir.oltean at nxp.com> wrote:
>
> Since the tsec driver supports both configurations with and without
> DM_ETH, and since the eth_ops :: set_promisc() method is only provided
> for DM_ETH, the implication is that builds with DM_ETH disabled will
> result in a 'defined but not used' warning.
>
> To silence those, mark the function as __maybe_unused.
>
> Fixes: 79ba3435f43d ("net: tsec: add support for promiscuous mode")
> Reported-by: Ramon Fried <rfried.dev at gmail.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
> ---
>  drivers/net/tsec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index 4354753cab9c..64bb42b0c006 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -156,7 +156,7 @@ static int tsec_mcast_addr(struct udevice *dev, const u8 *mcast_mac, int join)
>         return 0;
>  }
>
> -static int tsec_set_promisc(struct udevice *dev, bool enable)
> +static int __maybe_unused tsec_set_promisc(struct udevice *dev, bool enable)
>  {
>         struct tsec_private *priv = dev_get_priv(dev);
>         struct tsec __iomem *regs = priv->regs;
> --
> 2.25.1
>
Hi.
I will alter your original patch with this addition, as it wasn't merged yet.
We should have all our commits pass compilation.
Thanks,
Ramon


More information about the U-Boot mailing list