diff mbox series

net: tsec: mark tsec_set_promisc() as __maybe_unused

Message ID 20211031215158.4028047-1-vladimir.oltean@nxp.com
State Superseded
Delegated to: Ramon Fried
Headers show
Series net: tsec: mark tsec_set_promisc() as __maybe_unused | expand

Commit Message

Vladimir Oltean Oct. 31, 2021, 9:51 p.m. UTC
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@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/tsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ramon Fried Nov. 3, 2021, 6:57 a.m. UTC | #1
On Sun, Oct 31, 2021 at 11:52 PM Vladimir Oltean
<vladimir.oltean@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@gmail.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@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
diff mbox series

Patch

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;