clk: qoriq: Fix checkpatch type ALLOC_WITH_MULTIPLY
authorEmil Medve <Emilian.Medve@Freescale.com>
Wed, 21 Jan 2015 10:03:24 +0000 (04:03 -0600)
committerMichael Turquette <mturquette@linaro.org>
Wed, 28 Jan 2015 18:11:39 +0000 (10:11 -0800)
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>
drivers/clk/clk-qoriq.c

index 90ff6858c900a07767d99b2b1678f0d7fa72c413..475ce1c495e707762863ea87c0d1754542b673d8 100644 (file)
@@ -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;
@@ -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;