ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 29 Jul 2021 01:15:47 +0000 (10:15 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 29 Jul 2021 14:35:42 +0000 (15:35 +0100)
This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:2719:28: style: The scope of the variable 'component' can be reduced. [variableScope]
 struct snd_soc_component *component;
                           ^

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

index d4e3a6c5b5bb30c194b8d361da0f3383e4f2973e..e8fc6e06efdb6ff57fba10fe39c65a045362ec63 100644 (file)
@@ -2717,11 +2717,10 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_component_by_driver);
  */
 void snd_soc_unregister_component(struct device *dev)
 {
-       struct snd_soc_component *component;
-
        mutex_lock(&client_mutex);
        while (1) {
-               component = snd_soc_lookup_component_nolocked(dev, NULL);
+               struct snd_soc_component *component = snd_soc_lookup_component_nolocked(dev, NULL);
+
                if (!component)
                        break;