Browse Source

clk: versatile: Improve sizeof() usage

Replace the specification of a data structure by a pointer
dereference as the parameter for the operator "sizeof" to make
the corresponding size determination a bit safer according to the
Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Markus Elfring 7 years ago
parent
commit
a72da43c92
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/clk/versatile/clk-icst.c

+ 1 - 1
drivers/clk/versatile/clk-icst.c

@@ -359,7 +359,7 @@ static struct clk *icst_clk_setup(struct device *dev,
 	struct clk_init_data init;
 	struct icst_params *pclone;
 
-	icst = kzalloc(sizeof(struct clk_icst), GFP_KERNEL);
+	icst = kzalloc(sizeof(*icst), GFP_KERNEL);
 	if (!icst)
 		return ERR_PTR(-ENOMEM);