net: alteon: Avoid some useless memset
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 16 Jul 2020 20:52:42 +0000 (22:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jul 2020 19:57:59 +0000 (12:57 -0700)
Avoid a memset after a call to 'dma_alloc_coherent()'.
This is useless since
commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*")

Replace a kmalloc+memset with a corresponding kzalloc.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/alteon/acenic.c

index 99431c9a899b74899387fc86054e144641ec7e6d..ac86fcae1582d6eac2b1a64ec35fe9fb5c20beeb 100644 (file)
@@ -1151,7 +1151,7 @@ static int ace_init(struct net_device *dev)
        /*
         * Get the memory for the skb rings.
         */
-       if (!(ap->skb = kmalloc(sizeof(struct ace_skb), GFP_KERNEL))) {
+       if (!(ap->skb = kzalloc(sizeof(struct ace_skb), GFP_KERNEL))) {
                ecode = -EAGAIN;
                goto init_error;
        }
@@ -1172,9 +1172,6 @@ static int ace_init(struct net_device *dev)
        ap->last_mini_rx = 0;
 #endif
 
-       memset(ap->info, 0, sizeof(struct ace_info));
-       memset(ap->skb, 0, sizeof(struct ace_skb));
-
        ecode = ace_load_firmware(dev);
        if (ecode)
                goto init_error;