aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/clock
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-12-24 00:40:25 -0600
committerStephen Boyd <sboyd@kernel.org>2019-01-24 11:37:46 -0800
commit921e88a4f9649cbd44b4995ebe9a52b384e2fef4 (patch)
tree9bb65627b28c21451d7548e8baada95a5b4833aa /Documentation/devicetree/bindings/clock
parentLinux 5.0-rc1 (diff)
downloadlinux-dev-921e88a4f9649cbd44b4995ebe9a52b384e2fef4.tar.xz
linux-dev-921e88a4f9649cbd44b4995ebe9a52b384e2fef4.zip
clk: imx: imx7ulp: use struct_size() in kzalloc()
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'Documentation/devicetree/bindings/clock')
0 files changed, 0 insertions, 0 deletions