Skip to content

Commit

Permalink
octeontx2-af: Slightly simplify rvu_npc_exact_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe JAILLET authored and Jakub Kicinski committed Dec 1, 2022
1 parent 2450d7d commit b6a0eca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b6a0eca

Please sign in to comment.