]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: gianfar: Avoid 16 bytes of memset
authorEsben Haabendal <esben@geanix.com>
Thu, 17 Jun 2021 09:49:23 +0000 (11:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jun 2021 18:39:48 +0000 (11:39 -0700)
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>
drivers/net/ethernet/freescale/gianfar.c

index ebd1065f39fac920cd76931d0d1152c3a68e46d8..4608c0c337bcaea84b3b889301ebe87c9bbe45f2 100644 (file)
@@ -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);