octeontx2-af: Slightly simplify rvu_npc_exact_init()
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>
This commit is contained in:
parent
2450d7d93f
commit
b6a0ecaee2
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user