Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642690 > unrolled thread

[PATCH 1/2] sh-clk: Improve a size determination in sh_clk_fsidiv_register()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-16 19:40 +0200
Last post2017-05-16 19:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] sh-clk: Improve a size determination in  sh_clk_fsidiv_register() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-16 19:40 +0200

#1642690 — [PATCH 1/2] sh-clk: Improve a size determination in sh_clk_fsidiv_register()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-16 19:40 +0200
Subject[PATCH 1/2] sh-clk: Improve a size determination in sh_clk_fsidiv_register()
Message-ID<tHOBY-6g-9@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 May 2017 18:42:22 +0200

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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/sh/clk/cpg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index 7442bc130055..f23464bbeb7c 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -470,6 +470,5 @@ int __init sh_clk_fsidiv_register(struct clk *clks, int nr)
 	int i;
 
 	for (i = 0; i < nr; i++) {
-
-		map = kzalloc(sizeof(struct clk_mapping), GFP_KERNEL);
+		map = kzalloc(sizeof(*map), GFP_KERNEL);
 		if (!map) {
-- 
2.13.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web