[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50082E0D.9070202@mellanox.com>
Date: Thu, 19 Jul 2012 18:55:57 +0300
From: Or Gerlitz <ogerlitz@...lanox.com>
To: Ben Hutchings <bhutchings@...arflare.com>
CC: <davem@...emloft.net>, <roland@...nel.org>,
<netdev@...r.kernel.org>, <ali@...lanox.com>,
<sean.hefty@...el.com>, <shlomop@...lanox.com>,
Erez Shitrit <erezsh@...lanox.co.il>
Subject: Re: [PATCH net-next V1 5/9] net/eipoib: Add ethtool file support
On 7/18/2012 9:37 PM, Ben Hutchings wrote:
> +static void parent_get_strings(struct net_device *parent_dev,
> + uint32_t stringset, uint8_t *data)
> +{
> + int index = 0, stats_off = 0, i;
> +
> + if (stringset != ETH_SS_STATS)
> + return;
> +
> + for (i = 0; i < PORT_STATS_LEN; i++)
> + strcpy(data + (index++) * ETH_GSTRING_LEN,
> + parent_strings[i + stats_off]);
> +
> + stats_off += PORT_STATS_LEN;
> This is a very longwinded way to write:
> memcpy(data, parent_strings, sizeof(parent_strings));
SURE, will fix
>
>> +static int parent_get_sset_count(struct net_device *parent_dev, int sset)
>> +{
>> + switch (sset) {
>> + case ETH_SS_STATS:
>> + return PARENT_STATS_LEN;
>>
> [...]
>
> I get the feeling you've removed some code with unifdef; the result
> looks really weird, with PORT_STATS_LEN and PARENT_STATS_LEN used
> inconsistently.
yep, this needs cleanup, will do for V2
Or.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists