* [PATCH net] net: bcmgenet: device stats are unsigned long
@ 2016-04-15 17:47 Eric Dumazet
2016-04-17 2:04 ` David Miller
2016-04-18 0:49 ` Florian Fainelli
0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2016-04-15 17:47 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Florian Fainelli
From: Eric Dumazet <edumazet@google.com>
On 64bit kernels, device stats are 64bit wide, not 32bit.
Fixes: 1c1008c793fa4 ("net: bcmgenet: add main driver file")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index cf6445d148ca..44ad1490b472 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -878,7 +878,11 @@ static void bcmgenet_get_ethtool_stats(struct net_device *dev,
else
p = (char *)priv;
p += s->stat_offset;
- data[i] = *(u32 *)p;
+ if (sizeof(unsigned long) != sizeof(u32) &&
+ s->stat_sizeof == sizeof(unsigned long))
+ data[i] = *(unsigned long *)p;
+ else
+ data[i] = *(u32 *)p;
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: bcmgenet: device stats are unsigned long
2016-04-15 17:47 [PATCH net] net: bcmgenet: device stats are unsigned long Eric Dumazet
@ 2016-04-17 2:04 ` David Miller
2016-04-18 0:49 ` Florian Fainelli
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-04-17 2:04 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, f.fainelli
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 15 Apr 2016 10:47:52 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> On 64bit kernels, device stats are 64bit wide, not 32bit.
>
> Fixes: 1c1008c793fa4 ("net: bcmgenet: add main driver file")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: bcmgenet: device stats are unsigned long
2016-04-15 17:47 [PATCH net] net: bcmgenet: device stats are unsigned long Eric Dumazet
2016-04-17 2:04 ` David Miller
@ 2016-04-18 0:49 ` Florian Fainelli
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2016-04-18 0:49 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev
Le 15/04/2016 10:47, Eric Dumazet a écrit :
> From: Eric Dumazet <edumazet@google.com>
>
> On 64bit kernels, device stats are 64bit wide, not 32bit.
>
> Fixes: 1c1008c793fa4 ("net: bcmgenet: add main driver file")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
Late, but:
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks Eric!
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-18 0:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-15 17:47 [PATCH net] net: bcmgenet: device stats are unsigned long Eric Dumazet
2016-04-17 2:04 ` David Miller
2016-04-18 0:49 ` Florian Fainelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).