ASoC: codecs: rt298: remove redundant assignment to d_len_code
authorColin Ian King <colin.i.king@gmail.com>
Mon, 23 Oct 2023 15:49:17 +0000 (16:49 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 23 Oct 2023 18:40:22 +0000 (19:40 +0100)
Variable d_len_code is being initialized to zero and then re-assigned a
different value in all the valid cases in the following switch statement.
The only place it is not being assigned a value is on the return for
a default case and in this case it does not need to be assigned. The
initialization is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20231023154917.671595-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt298.c

index 8fbd25ad9b47d6a7ed602dacbb2a872d59fbaaa8..ad3783ade1b54aefc8a1a42de706968803038521 100644 (file)
@@ -789,7 +789,6 @@ static int rt298_hw_params(struct snd_pcm_substream *substream,
                return -EINVAL;
        }
 
-       d_len_code = 0;
        switch (params_width(params)) {
        /* bit 6:4 Bits per Sample */
        case 16: