summaryrefslogtreecommitdiffstats
path: root/drivers/clk/uniphier
diff options
context:
space:
mode:
authorStephen Kitt <steve@sk2.org>2019-09-27 20:51:10 +0200
committerStephen Boyd <sboyd@kernel.org>2019-11-08 17:36:12 +0100
commite620a1e061c4738e26c3edf2abaae7842532cd80 (patch)
treed1f50993a22b103b7149d884e7f8044c57a5eb28 /drivers/clk/uniphier
parentLinux 5.4-rc1 (diff)
downloadlinux-e620a1e061c4738e26c3edf2abaae7842532cd80.tar.xz
linux-e620a1e061c4738e26c3edf2abaae7842532cd80.zip
drivers/clk: convert VL struct to struct_size
There are a few manually-calculated variable-length struct allocations left, this converts them to use struct_size. Found with the following git grep command git grep -A1 'kzalloc.*sizeof[^_].*+' Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lkml.kernel.org/r/20190927185110.29897-1-steve@sk2.org Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com> [sboyd@kernel.org: Add grep command] Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/uniphier')
-rw-r--r--drivers/clk/uniphier/clk-uniphier-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/clk/uniphier/clk-uniphier-core.c b/drivers/clk/uniphier/clk-uniphier-core.c
index c6aaca73cf86..12380236d7ab 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -64,8 +64,7 @@ static int uniphier_clk_probe(struct platform_device *pdev)
for (p = data; p->name; p++)
clk_num = max(clk_num, p->idx + 1);
- hw_data = devm_kzalloc(dev,
- sizeof(*hw_data) + clk_num * sizeof(struct clk_hw *),
+ hw_data = devm_kzalloc(dev, struct_size(hw_data, hws, clk_num),
GFP_KERNEL);
if (!hw_data)
return -ENOMEM;