Skip to content

Commit

Permalink
clk: qoriq: Fix checkpatch type ALLOC_SIZEOF_STRUCT
Browse files Browse the repository at this point in the history
CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*cmux_clk)...) over kzalloc(sizeof(struct cmux_clk)...)
+       cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);

CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc(sizeof(*onecell_data)...) over kzalloc(sizeof(struct clk_onecell_data)...)
+       onecell_data = kzalloc(sizeof(struct clk_onecell_data), 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 a924722 commit 13c25f5
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 @@ -94,7 +94,7 @@ static void __init core_mux_init(struct device_node *np)
for (i = 0; i < count; i++)
parent_names[i] = of_clk_get_parent_name(np, i);

cmux_clk = kzalloc(sizeof(struct cmux_clk), GFP_KERNEL);
cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL);
if (!cmux_clk) {
pr_err("%s: could not allocate cmux_clk\n", __func__);
goto err_name;
Expand Down Expand Up @@ -198,7 +198,7 @@ static void __init core_pll_init(struct device_node *np)
goto err_map;
}

onecell_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL);
if (!onecell_data) {
pr_err("%s: could not allocate onecell_data\n", __func__);
goto err_clks;
Expand Down

0 comments on commit 13c25f5

Please sign in to comment.