summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-28 11:22:59 +0100
committerStephen Boyd <sboyd@codeaurora.org>2016-02-02 02:01:43 +0100
commit3a6e84545129913613dc1a97bbe8e4f2378696ee (patch)
tree808dbdb6da04c503ced4afac648592628d9ef935 /drivers/clk/clk.c
parentclk: remove unnecessary !core->parents conditional (diff)
downloadlinux-3a6e84545129913613dc1a97bbe8e4f2378696ee.tar.xz
linux-3a6e84545129913613dc1a97bbe8e4f2378696ee.zip
clk: change sizeof(struct clk *) to sizeof(*core->parents)
Now, the clock parent is not "struct clk *", but "struct clk_core *". Of course, the size of a pointer is always same, but strictly speaking, sizeof(struct clk *) should be sizeof(struct clk_core *) here. This mismatch happened when we split the structure into struct clk and struct clk_core. For the potential possibility of future renaming, sizeof(*core->parents) would be better. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 735828d55c00..f9cab0919bb4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1069,7 +1069,7 @@ static int clk_fetch_parent_index(struct clk_core *core,
if (!core->parents) {
core->parents = kcalloc(core->num_parents,
- sizeof(struct clk *), GFP_KERNEL);
+ sizeof(*core->parents), GFP_KERNEL);
if (!core->parents)
return -ENOMEM;
}
@@ -1720,7 +1720,7 @@ static struct clk_core *__clk_init_parent(struct clk_core *core)
if (!core->parents)
core->parents =
- kcalloc(core->num_parents, sizeof(struct clk *),
+ kcalloc(core->num_parents, sizeof(*core->parents),
GFP_KERNEL);
ret = clk_core_get_parent_by_index(core, index);
@@ -2368,8 +2368,8 @@ static int __clk_core_init(struct clk_core *core)
* necessary.
*/
if (core->num_parents > 1) {
- core->parents = kcalloc(core->num_parents, sizeof(struct clk *),
- GFP_KERNEL);
+ core->parents = kcalloc(core->num_parents,
+ sizeof(*core->parents), GFP_KERNEL);
/*
* clk_core_lookup returns NULL for parents that have not been
* clk_init'd; thus any access to clk->parents[] must check