diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-04-20 09:30:52 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-04-21 19:47:02 -0700 |
commit | 1808a3201965c430b70cb9236ff80d2cad403452 (patch) | |
tree | 45e9d85b836404fa5c3d59ca2eac0360454ed02e | |
parent | 4d32758671527761e6ee94568b8e32925c4bc682 (diff) | |
download | op-kernel-dev-1808a3201965c430b70cb9236ff80d2cad403452.zip op-kernel-dev-1808a3201965c430b70cb9236ff80d2cad403452.tar.gz |
clk: Improve a size determination in two functions
Replace the specification of two 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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/clk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 3e5562a1..fc58c52 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2973,7 +2973,7 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) /* if clk wasn't in the notifier list, allocate new clk_notifier */ if (cn->clk != clk) { - cn = kzalloc(sizeof(struct clk_notifier), GFP_KERNEL); + cn = kzalloc(sizeof(*cn), GFP_KERNEL); if (!cn) goto out; @@ -3121,7 +3121,7 @@ int of_clk_add_provider(struct device_node *np, struct of_clk_provider *cp; int ret; - cp = kzalloc(sizeof(struct of_clk_provider), GFP_KERNEL); + cp = kzalloc(sizeof(*cp), GFP_KERNEL); if (!cp) return -ENOMEM; |