From: Markus Elfring Date: Tue, 26 Sep 2017 17:33:02 +0000 (+0200) Subject: clk: clk-u300: Improve sizeof() usage X-Git-Tag: v4.15-rc1~48^2^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=27f8a53a9decfd7ad785543eb4e2c3d44434c01e;p=thirdparty%2Fkernel%2Flinux.git clk: clk-u300: Improve sizeof() usage Replace the specification of data structures by pointer dereferences 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 Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/clk-u300.c b/drivers/clk/clk-u300.c index e524c37752648..ae78461c78366 100644 --- a/drivers/clk/clk-u300.c +++ b/drivers/clk/clk-u300.c @@ -702,7 +702,7 @@ syscon_clk_register(struct device *dev, const char *name, struct clk_init_data init; int ret; - sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL); + sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); if (!sclk) return ERR_PTR(-ENOMEM); @@ -1121,7 +1121,7 @@ mclk_clk_register(struct device *dev, const char *name, struct clk_init_data init; int ret; - mclk = kzalloc(sizeof(struct clk_mclk), GFP_KERNEL); + mclk = kzalloc(sizeof(*mclk), GFP_KERNEL); if (!mclk) return ERR_PTR(-ENOMEM);