[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87608jdmxu.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
Date:   Wed, 03 Jan 2018 09:41:33 -0500
From:   Vivien Didelot <vivien.didelot@...oirfairelinux.com>
To:     Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        netdev <netdev@...r.kernel.org>,
        Russell King <rmk+kernel@....linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next 1/5] dsa: Pass the port to get_sset_count()
Hi Andrew,
Andrew Lunn <andrew@...n.ch> writes:
> --- a/net/dsa/master.c
> +++ b/net/dsa/master.c
> @@ -42,7 +42,7 @@ static int dsa_master_get_sset_count(struct net_device *dev, int sset)
>  		count += ops->get_sset_count(dev, sset);
>  
>  	if (sset == ETH_SS_STATS && ds->ops->get_sset_count)
> -		count += ds->ops->get_sset_count(ds);
> +		count += ds->ops->get_sset_count(ds, cpu_dp->index);
>  
>  	return count;
>  }
> @@ -76,7 +76,7 @@ static void dsa_master_get_strings(struct net_device *dev, uint32_t stringset,
>  		 * constructed earlier
>  		 */
>  		ds->ops->get_strings(ds, port, ndata);
> -		count = ds->ops->get_sset_count(ds);
> +		count = ds->ops->get_sset_count(ds, cpu_dp->index);
You could reuse the 'port' variable already assigned to cpu_dp->index.
>  		for (i = 0; i < count; i++) {
>  			memmove(ndata + (i * len + sizeof(pfx)),
>  				ndata + i * len, len - sizeof(pfx));
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index f52307296de4..0d07004d59d4 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -559,7 +559,7 @@ static int dsa_slave_get_sset_count(struct net_device *dev, int sset)
>  
>  		count = 4;
>  		if (ds->ops->get_sset_count)
> -			count += ds->ops->get_sset_count(ds);
> +			count += ds->ops->get_sset_count(ds, dp->index);
>  
>  		return count;
>  	}
Otherwise:
Reviewed-by: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Thanks,
        Vivien
Powered by blists - more mailing lists