Re: [PATCH] net/macb: fix sparse warning

From: Eric Dumazet
Date: Thu Feb 05 2015 - 11:29:35 EST


On Thu, 2015-02-05 at 15:40 +0000, Lad Prabhakar wrote:
> From: "Lad, Prabhakar" <prabhakar.csengg@xxxxxxxxx>
>
> this patch fixes following sparse warning:
>
> macb.c:2038:26: warning: symbol 'gem_ethtool_ops' was not declared. Should it be static?
>
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
> ---
> Found this issue on linux-next (gcc version 4.8.2,
> sparse version 0.4.5-rc1)and applies on top linux-next.
>
> drivers/net/ethernet/cadence/macb.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
> index 31dc080..e6ad68a 100644
> --- a/drivers/net/ethernet/cadence/macb.h
> +++ b/drivers/net/ethernet/cadence/macb.h
> @@ -821,6 +821,7 @@ struct macb {
> };
>
> extern const struct ethtool_ops macb_ethtool_ops;
> +extern const struct ethtool_ops gem_ethtool_ops;
>
> int macb_mii_init(struct macb *bp);
> int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);

Certainly not.

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 4f7bd13796b87b873a198ffd0760dedbb9077ed4..ad76b8e35a00e188e39d00f4c5f70d97c3df5363 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2035,7 +2035,7 @@ const struct ethtool_ops macb_ethtool_ops = {
};
EXPORT_SYMBOL_GPL(macb_ethtool_ops);

-const struct ethtool_ops gem_ethtool_ops = {
+static const struct ethtool_ops gem_ethtool_ops = {
.get_settings = macb_get_settings,
.set_settings = macb_set_settings,
.get_regs_len = macb_get_regs_len,
@@ -2046,7 +2046,6 @@ const struct ethtool_ops gem_ethtool_ops = {
.get_strings = gem_get_ethtool_strings,
.get_sset_count = gem_get_sset_count,
};
-EXPORT_SYMBOL_GPL(gem_ethtool_ops);

int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/