OpenCloudOS-Kernel/sound/soc/qcom
Gustavo A. R. Silva e718a3eb09
ASoC: qdsp6: q6core: Use struct_size() in kmemdup()
Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace code of the following form:

sizeof(*fwk) + fwk->num_services * sizeof(fwk->svc_api_info[0]);

with:

struct_size(fwk, svc_api_info, fwk->num_services)

and so on...

Notice that variables bytes and len are unnecessary, hence they are
removed.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-24 13:01:57 +01:00
..
qdsp6 ASoC: qdsp6: q6core: Use struct_size() in kmemdup() 2019-05-24 13:01:57 +01:00
Kconfig ASoC: qcom: add i2c dependency for SND_SOC_SDM845 2019-03-11 16:31:49 +00:00
Makefile ASoC: qcom: make common.c as proper module 2018-08-06 12:50:04 +01:00
apq8016_sbc.c ASoC: qcom: Fix of-node refcount unbalance in apq8016_sbc_parse_of() 2019-02-20 16:43:29 +00:00
apq8096.c ASoC: apq8096: add slim support 2019-01-28 18:19:10 +00:00
common.c ASoC: qcom: Fix of-node refcount unbalance in qcom_snd_parse_of() 2019-02-20 16:43:42 +00:00
common.h ASoC: qcom: remove unused header files from common.h 2018-08-06 12:50:07 +01:00
lpass-apq8016.c ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
lpass-cpu.c ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
lpass-ipq806x.c ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
lpass-lpaif-reg.h ASoC: qcom: add generic bit masks for RDMA and WRDMA 2016-02-20 01:20:18 +09:00
lpass-platform.c ASoC: qcom: clean up indentation, remove extraneous tab 2018-11-16 19:08:32 -08:00
lpass.h ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
sdm845.c ASoC: sdm845: Set DAI format for dmic codec 2019-01-16 16:33:02 +00:00
storm.c ASoC: qcom: Remove unnecessary function call 2017-08-21 17:14:00 +01:00