]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Intel: Skylake: Use struct_size() helper
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Thu, 23 May 2019 22:23:33 +0000 (17:23 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 24 May 2019 12:01:38 +0000 (13:01 +0100)
commit2f4f2563154f220566d43063112d49654e49ed34
treeb6c230d37b4cea83290b665ac06ebcb3f90ac8d3
parent0ca3e6e7461962ae1bf7292595b243a3391f995d
ASoC: Intel: Skylake: Use struct_size() helper

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 the following form:

uuid_params->num_modules * sizeof(struct skl_mod_inst_map) + sizeof(uuid_params->num_modules)

with:

struct_size(params, u.map, uuid_params->num_modules)

and so on...

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>
sound/soc/intel/skylake/skl-topology.c