summaryrefslogtreecommitdiff
path: root/drivers/clk/imgtec
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 08:36:12 -0800
commite620a1e061c4738e26c3edf2abaae7842532cd80 (patch)
treed1f50993a22b103b7149d884e7f8044c57a5eb28 /drivers/clk/imgtec
parent54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c (diff)
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/imgtec')
-rw-r--r--drivers/clk/imgtec/clk-boston.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/clk/imgtec/clk-boston.c b/drivers/clk/imgtec/clk-boston.c
index 33ab4ff61165..b00cbd045af5 100644
--- a/drivers/clk/imgtec/clk-boston.c
+++ b/drivers/clk/imgtec/clk-boston.c
@@ -58,8 +58,7 @@ static void __init clk_boston_setup(struct device_node *np)
cpu_div = ext_field(mmcmdiv, BOSTON_PLAT_MMCMDIV_CLK1DIV);
cpu_freq = mult_frac(in_freq, mul, cpu_div);
- onecell = kzalloc(sizeof(*onecell) +
- (BOSTON_CLK_COUNT * sizeof(struct clk_hw *)),
+ onecell = kzalloc(struct_size(onecell, hws, BOSTON_CLK_COUNT),
GFP_KERNEL);
if (!onecell)
return;