summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsben Haabendal <esben@geanix.com>2021-06-17 12:49:23 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-17 21:39:48 +0300
commite2dbbbe52c4a0f7704735b49f864fe8ea06111e5 (patch)
treecfdd39c77081894d496d7053d25a4179270d64cd
parentef09487431a96029b64a7a6fc4ced46662e921e7 (diff)
downloadlinux-e2dbbbe52c4a0f7704735b49f864fe8ea06111e5.tar.xz
net: gianfar: Avoid 16 bytes of memset
The memset on CAMx is wrong, as it actually unmasks all carry irq's, which we clearly are not interested in. The memset on CARx registers is just pointless, as they are W1C. So let's just stop the memset before CAR1. Signed-off-by: Esben Haabendal <esben@geanix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index ebd1065f39fa..4608c0c337bc 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -3098,7 +3098,7 @@ static void gfar_hw_init(struct gfar_private *priv)
/* Zero out the rmon mib registers if it has them */
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_RMON) {
- memset_io(&(regs->rmon), 0, sizeof(struct rmon_mib));
+ memset_io(&regs->rmon, 0, offsetof(struct rmon_mib, car1));
/* Mask off the CAM interrupts */
gfar_write(&regs->rmon.cam1, 0xffffffff);