Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27f8a53a authored by Markus Elfring's avatar Markus Elfring Committed by Stephen Boyd
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent de8cd467
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -702,7 +702,7 @@ syscon_clk_register(struct device *dev, const char *name,
	struct clk_init_data init;
	struct clk_init_data init;
	int ret;
	int ret;


	sclk = kzalloc(sizeof(struct clk_syscon), GFP_KERNEL);
	sclk = kzalloc(sizeof(*sclk), GFP_KERNEL);
	if (!sclk)
	if (!sclk)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);


@@ -1121,7 +1121,7 @@ mclk_clk_register(struct device *dev, const char *name,
	struct clk_init_data init;
	struct clk_init_data init;
	int ret;
	int ret;


	mclk = kzalloc(sizeof(struct clk_mclk), GFP_KERNEL);
	mclk = kzalloc(sizeof(*mclk), GFP_KERNEL);
	if (!mclk)
	if (!mclk)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);