ALSA: compress_offload: remove redundant initialization
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 2 Sep 2020 21:21:22 +0000 (16:21 -0500)
committerTakashi Iwai <tiwai@suse.de>
Thu, 3 Sep 2020 07:26:27 +0000 (09:26 +0200)
Fix cppcheck warning:

sound/core/compress_offload.c:1044:6: style: Redundant initialization
for 'ret'. The initialized value is overwritten before it is
read. [redundantInitialization]

 ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS,
     ^
sound/core/compress_offload.c:1034:10: note: ret is initialized
 int ret = -EINVAL;
         ^
sound/core/compress_offload.c:1044:6: note: ret is overwritten
 ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS,
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200902212133.30964-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/compress_offload.c

index e3eb314acb106806e8de53b3ca2e72d08eeb4589..c1fec932c49d1f62e44143124569b7fd90476cdb 100644 (file)
@@ -1032,7 +1032,7 @@ static const struct file_operations snd_compr_file_ops = {
 
 static int snd_compress_dev_register(struct snd_device *device)
 {
-       int ret = -EINVAL;
+       int ret;
        struct snd_compr *compr;
 
        if (snd_BUG_ON(!device || !device->device_data))