summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-04-15 19:47:52 +0200
committerDavid S. Miller <davem@davemloft.net>2016-04-17 04:03:39 +0200
commit6517eb59b03965689e6bb16bb2d480096b3ef95d (patch)
tree01e4c3ef8fb79eed5f34697334420ccf894dea08 /drivers/net
parentMerge branch 'dsa-mv88e6xxx-fix-cross-chip-bridging' (diff)
downloadlinux-6517eb59b03965689e6bb16bb2d480096b3ef95d.tar.xz
linux-6517eb59b03965689e6bb16bb2d480096b3ef95d.zip
net: bcmgenet: device stats are unsigned long
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c6
1 files changed, 5 insertions, 1 deletions
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;
}
}