summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/genet/bcmgenet.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-04-15 10:47:52 -0700
committerDavid S. Miller <davem@davemloft.net>2016-04-16 22:03:39 -0400
commit6517eb59b03965689e6bb16bb2d480096b3ef95d (patch)
tree01e4c3ef8fb79eed5f34697334420ccf894dea08 /drivers/net/ethernet/broadcom/genet/bcmgenet.c
parentcf6b5fb2514de55d5f97d5f55a251de4de17d07e (diff)
downloadop-kernel-dev-6517eb59b03965689e6bb16bb2d480096b3ef95d.zip
op-kernel-dev-6517eb59b03965689e6bb16bb2d480096b3ef95d.tar.gz
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/ethernet/broadcom/genet/bcmgenet.c')
-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 cf6445d..44ad149 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;
}
}
OpenPOWER on IntegriCloud