OSDN Git Service

ASoC: sh: siu_pcm: remove useless assignment
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 19 Feb 2021 23:16:34 +0000 (17:16 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:07:03 +0000 (13:07 +0000)
cppcheck warning:

sound/soc/sh/siu_pcm.c:375:5: style: Redundant initialization for
'rt'. The initialized value is overwritten before it is
read. [redundantInitialization]

 rt = siu_stream->substream->runtime;
    ^
sound/soc/sh/siu_pcm.c:366:30: note: rt is initialized
 struct snd_pcm_runtime  *rt = ss->runtime;
                             ^
sound/soc/sh/siu_pcm.c:375:5: note: rt is overwritten
 rt = siu_stream->substream->runtime;
    ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210219231635.5749-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/siu_pcm.c

index 4785886..6496300 100644 (file)
@@ -363,7 +363,7 @@ static int siu_pcm_prepare(struct snd_soc_component *component,
        struct siu_info *info = siu_i2s_data;
        struct siu_port *port_info = siu_port_info(ss);
        struct device *dev = ss->pcm->card->dev;
-       struct snd_pcm_runtime  *rt = ss->runtime;
+       struct snd_pcm_runtime *rt;
        struct siu_stream *siu_stream;
        snd_pcm_sframes_t xfer_cnt;