Skip to content

Commit

Permalink
ethernet: ti: cpts: Use devm_kcalloc() instead of devm_kzalloc()
Browse files Browse the repository at this point in the history
Use 2-factor multiplication argument form devm_kcalloc() instead
of devm_kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211006181115.GA913499@embeddedor
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Gustavo A. R. Silva authored and Jakub Kicinski committed Oct 7, 2021
1 parent 3637187 commit c514fbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/ti/cpts.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,10 @@ static int cpts_of_mux_clk_setup(struct cpts *cpts, struct device_node *node)
goto mux_fail;
}

parent_names = devm_kzalloc(cpts->dev, (sizeof(char *) * num_parents),
GFP_KERNEL);
parent_names = devm_kcalloc(cpts->dev, num_parents,
sizeof(*parent_names), GFP_KERNEL);

mux_table = devm_kzalloc(cpts->dev, sizeof(*mux_table) * num_parents,
mux_table = devm_kcalloc(cpts->dev, num_parents, sizeof(*mux_table),
GFP_KERNEL);
if (!mux_table || !parent_names) {
ret = -ENOMEM;
Expand Down

0 comments on commit c514fbb

Please sign in to comment.