]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 2 Aug 2021 06:01:04 +0000 (15:01 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 2 Aug 2021 11:21:30 +0000 (12:21 +0100)
This patch cleanups below cppcheck warning.

sound/soc/soc-topology.c:1038:31: style: The scope of the variable 'control_hdr' can be reduced. [variableScope]
 struct snd_soc_tplg_ctl_hdr *control_hdr;
                              ^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8agwfkv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c

index 98e08afd8eb9107a4eac558bbae3b1b99e986df3..a052dfe5efb61371fcf46ce712bf7f1f5cabe300 100644 (file)
@@ -1035,7 +1035,6 @@ err_denum:
 static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,
        struct snd_soc_tplg_hdr *hdr)
 {
-       struct snd_soc_tplg_ctl_hdr *control_hdr;
        int ret;
        int i;
 
@@ -1043,8 +1042,7 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,
                soc_tplg_get_offset(tplg));
 
        for (i = 0; i < le32_to_cpu(hdr->count); i++) {
-
-               control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
+               struct snd_soc_tplg_ctl_hdr *control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
 
                if (le32_to_cpu(control_hdr->size) != sizeof(*control_hdr)) {
                        dev_err(tplg->dev, "ASoC: invalid control size\n");