Commit b6a0ecae authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jakub Kicinski

octeontx2-af: Slightly simplify rvu_npc_exact_init()

Use kzalloc() instead of kmalloc()/memset().
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/60ea220ccf3b61963f7d5a97e3df2c76a5feb837.1669378798.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2450d7d9
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment