Skip to content

Commit

Permalink
clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
Browse files Browse the repository at this point in the history
WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply
+       subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
  • Loading branch information
Emil Medve authored and Michael Turquette committed Jan 28, 2015
1 parent 78f4a63 commit a924722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/clk/clk-qoriq.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void __init core_mux_init(struct device_node *np)
pr_err("%s: get clock count error\n", np->name);
return;
}
parent_names = kzalloc((sizeof(char *) * count), GFP_KERNEL);
parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL);
if (!parent_names) {
pr_err("%s: could not allocate parent_names\n", __func__);
return;
Expand Down Expand Up @@ -192,7 +192,7 @@ static void __init core_pll_init(struct device_node *np)
goto err_map;
}

subclks = kzalloc(sizeof(struct clk *) * count, GFP_KERNEL);
subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL);
if (!subclks) {
pr_err("%s: could not allocate subclks\n", __func__);
goto err_map;
Expand Down

0 comments on commit a924722

Please sign in to comment.