OSDN Git Service

octeontx2-af: Slightly simplify rvu_npc_exact_init()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 25 Nov 2022 12:23:58 +0000 (13:23 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 Dec 2022 04:42:19 +0000 (20:42 -0800)
Use kzalloc() instead of kmalloc()/memset().

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/60ea220ccf3b61963f7d5a97e3df2c76a5feb837.1669378798.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c

index 5e6c545..c584680 100644 (file)
@@ -1870,12 +1870,11 @@ int rvu_npc_exact_init(struct rvu *rvu)
        /* Set capability to true */
        rvu->hw->cap.npc_exact_match_enabled = true;
 
-       table = kmalloc(sizeof(*table), GFP_KERNEL);
+       table = kzalloc(sizeof(*table), GFP_KERNEL);
        if (!table)
                return -ENOMEM;
 
        dev_dbg(rvu->dev, "%s: Memory allocation for table success\n", __func__);
-       memset(table, 0, sizeof(*table));
        rvu->hw->table = table;
 
        /* Read table size, ways and depth */