diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-08-02 15:00:42 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-08-02 12:21:28 +0100 |
commit | 65a4cfdd6f2bc04b0c3d3607c48ceeac999c9424 (patch) | |
tree | 26a0f790315e6f8a0c5ca45d9396ccd8d25d0837 /sound/soc/soc-topology.c | |
parent | f79e4b2a38eda4e365f765d363f47cf0c2183ab4 (diff) | |
download | lwn-65a4cfdd6f2bc04b0c3d3607c48ceeac999c9424.tar.gz lwn-65a4cfdd6f2bc04b0c3d3607c48ceeac999c9424.zip |
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()
This patch cleanups below cppcheck warning.
sound/soc/soc-topology.c:2350:27: style: The scope of the variable 'dai' can be reduced. [variableScope]
struct snd_soc_tplg_dai *dai;
^
sound/soc/soc-topology.c:2352:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
int i, ret;
^
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1fcwflh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r-- | sound/soc/soc-topology.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 9aa7c9c4768b..359c6ac22153 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2346,15 +2346,16 @@ err: static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) { - struct snd_soc_tplg_dai *dai; int count; - int i, ret; + int i; count = le32_to_cpu(hdr->count); /* config the existing BE DAIs */ for (i = 0; i < count; i++) { - dai = (struct snd_soc_tplg_dai *)tplg->pos; + struct snd_soc_tplg_dai *dai = (struct snd_soc_tplg_dai *)tplg->pos; + int ret; + if (le32_to_cpu(dai->size) != sizeof(*dai)) { dev_err(tplg->dev, "ASoC: invalid physical DAI size\n"); return -EINVAL; |