All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: tsec: mark tsec_set_promisc() as __maybe_unused
@ 2021-10-31 21:51 Vladimir Oltean
  2021-11-03  6:57 ` Ramon Fried
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2021-10-31 21:51 UTC (permalink / raw)
  To: u-boot, Joe Hershberger, Ramon Fried; +Cc: Bin Meng

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: tsec: mark tsec_set_promisc() as __maybe_unused
  2021-10-31 21:51 [PATCH] net: tsec: mark tsec_set_promisc() as __maybe_unused Vladimir Oltean
@ 2021-11-03  6:57 ` Ramon Fried
  0 siblings, 0 replies; 2+ messages in thread
From: Ramon Fried @ 2021-11-03  6:57 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: U-Boot Mailing List, Joe Hershberger, Bin Meng

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-03  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31 21:51 [PATCH] net: tsec: mark tsec_set_promisc() as __maybe_unused Vladimir Oltean
2021-11-03  6:57 ` Ramon Fried

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.