[PATCH 07/18] ALSA: compress_offload: remove redundant initialization

Vinod Koul vkoul at kernel.org
Thu Sep 3 06:47:35 CEST 2020


On 02-09-20, 16:21, Pierre-Louis Bossart wrote:
> 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,
>      ^
> 

Acked-By: Vinod Koul <vkoul at kernel.org>

> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> ---
>  sound/core/compress_offload.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
> index e3eb314acb10..c1fec932c49d 100644
> --- a/sound/core/compress_offload.c
> +++ b/sound/core/compress_offload.c
> @@ -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))
> -- 
> 2.25.1

-- 
~Vinod


More information about the Alsa-devel mailing list