]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: versatile: Improve sizeof() usage
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 27 Sep 2017 19:24:43 +0000 (21:24 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 14 Nov 2017 01:42:56 +0000 (17:42 -0800)
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>
drivers/clk/versatile/clk-icst.c

index 20ab4ceffb28a5c4f874cbf362ec269025075ac0..dafe7a45875d9ef7e27bde705396e6c0d3cbe045 100644 (file)
@@ -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);