[PATCH 17/18] ALSA: vx: vx_pcm: remove redundant assignment

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed Sep 2 23:21:32 CEST 2020


Fix cppcheck warning:

sound/drivers/vx/vx_pcm.c:539:30: style: Variable
'chip->playback_pipes[audio]' is reassigned a value before the old one
has been used. [redundantAssignment]
 chip->playback_pipes[audio] = pipe;
                             ^
sound/drivers/vx/vx_pcm.c:533:31: note: chip->playback_pipes[audio] is
assigned
  chip->playback_pipes[audio] = pipe;
                              ^
sound/drivers/vx/vx_pcm.c:539:30: note: chip->playback_pipes[audio] is
overwritten
 chip->playback_pipes[audio] = pipe;
                             ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
 sound/drivers/vx/vx_pcm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 664b9efa9a50..47361e26be80 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -530,7 +530,6 @@ static int vx_pcm_playback_open(struct snd_pcm_substream *subs)
 		err = vx_alloc_pipe(chip, 0, audio, 2, &pipe); /* stereo playback */
 		if (err < 0)
 			return err;
-		chip->playback_pipes[audio] = pipe;
 	}
 	/* open for playback */
 	pipe->references++;
-- 
2.25.1



More information about the Alsa-devel mailing list