Subject: Re: [PATCH net] net: bcmsysport: Device stats are unsigned long

From: Florian Fainelli <[email-masked]>
Date: Thu, 30 Jun 2016 12:58:47 -0700

On 06/30/2016 11:33 AM, Andrew Lunn wrote:
> On Thu, Jun 30, 2016 at 10:56:29AM -0700, Florian Fainelli wrote:
>> On 64bits kernels, device stats are 64bits wide, not 32bits.
>>
>> Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
>> Signed-off-by: Florian Fainelli <[email-masked]>
>> ---
>>  drivers/net/ethernet/broadcom/bcmsysport.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
>> index 543bf38105c9..21f21e23e695 100644
>> --- a/drivers/net/ethernet/broadcom/bcmsysport.c
>> +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
>> @@ -392,7 +392,11 @@ static void bcm_sysport_get_stats(struct net_device *dev,
>>  		else
>>  			p = (char *)priv;
>>  		p += s->stat_offset;
>> -		data[i] = *(u32 *)p;
> 
> Hi Florian
> 
> Could you not just change this cast from u32 to unsigned long and be
> done?

Seems like this would work yes, even with our mixture of u32 stats read
from HW and the software netdev stats, thanks!
-- 
Florian