]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: cavium: liquidio: use kzalloc in setup_glist()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Wed, 9 Sep 2015 08:38:02 +0000 (10:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2015 00:06:00 +0000 (17:06 -0700)
We save a little .text and get rid of the sizeof(...) style
inconsistency.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_main.c

index 0660deecc2c9a77f88e4eb9a0dbe02a68d0fec86..f683d97d7614e7414ccf837ead2e2a507b07e4d3 100644 (file)
@@ -818,10 +818,9 @@ static int setup_glist(struct lio *lio)
        INIT_LIST_HEAD(&lio->glist);
 
        for (i = 0; i < lio->tx_qsize; i++) {
-               g = kmalloc(sizeof(*g), GFP_KERNEL);
+               g = kzalloc(sizeof(*g), GFP_KERNEL);
                if (!g)
                        break;
-               memset(g, 0, sizeof(struct octnic_gather));
 
                g->sg_size =
                        ((ROUNDUP4(OCTNIC_MAX_SG) >> 2) * OCT_SG_ENTRY_SIZE);