Patchwork [v2,7/7] clk: sunxi: drop an unnecesary kmalloc

login
register
mail settings
Submitter Emilio López
Date March 27, 2013, 9:20 p.m.
Message ID <1364419243-18446-8-git-send-email-emilio@elopez.com.ar>
Download mbox | patch
Permalink /patch/231837/
State New
Headers show

Comments

Emilio López - March 27, 2013, 9:20 p.m.
clk_register will copy this information, so we can just use a normal
array and do one less dynamic allocation.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
---

Changes from v1:
  - this patch was not present on v1

 drivers/clk/sunxi/clk-sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Mike Turquette - April 3, 2013, 9:49 p.m.
Quoting Emilio López (2013-03-27 14:20:43)
> clk_register will copy this information, so we can just use a normal
> array and do one less dynamic allocation.
> 
> Signed-off-by: Emilio López <emilio@elopez.com.ar>

Looks good to me.

Regards,
Mike

> ---
> 
> Changes from v1:
>   - this patch was not present on v1
> 
>  drivers/clk/sunxi/clk-sunxi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
> index daa51ab..0bb0eb4 100644
> --- a/drivers/clk/sunxi/clk-sunxi.c
> +++ b/drivers/clk/sunxi/clk-sunxi.c
> @@ -232,7 +232,7 @@ static void __init sunxi_mux_clk_setup(struct device_node *node,
>  {
>         struct clk *clk;
>         const char *clk_name = node->name;
> -       const char **parents = kmalloc(sizeof(char *) * 5, GFP_KERNEL);
> +       const char *parents[5];
>         void *reg;
>         int i = 0;
>  
> -- 
> 1.8.2

Patch

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index daa51ab..0bb0eb4 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -232,7 +232,7 @@  static void __init sunxi_mux_clk_setup(struct device_node *node,
 {
 	struct clk *clk;
 	const char *clk_name = node->name;
-	const char **parents = kmalloc(sizeof(char *) * 5, GFP_KERNEL);
+	const char *parents[5];
 	void *reg;
 	int i = 0;