diff options
author | Stephen Kitt <steve@sk2.org> | 2019-09-27 20:51:10 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2019-11-08 17:36:12 +0100 |
commit | e620a1e061c4738e26c3edf2abaae7842532cd80 (patch) | |
tree | d1f50993a22b103b7149d884e7f8044c57a5eb28 /drivers/clk/at91 | |
parent | Linux 5.4-rc1 (diff) | |
download | linux-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/at91')
-rw-r--r-- | drivers/clk/at91/sckc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c index 9bfe9a28294a..5ad6180449cb 100644 --- a/drivers/clk/at91/sckc.c +++ b/drivers/clk/at91/sckc.c @@ -478,8 +478,7 @@ static void __init of_sam9x60_sckc_setup(struct device_node *np) if (IS_ERR(slow_osc)) goto unregister_slow_rc; - clk_data = kzalloc(sizeof(*clk_data) + (2 * sizeof(struct clk_hw *)), - GFP_KERNEL); + clk_data = kzalloc(struct_size(clk_data, hws, 2), GFP_KERNEL); if (!clk_data) goto unregister_slow_osc; |