Skip to content

Commit 181d58c

Browse files
Dan Carpenterbroonie
authored andcommitted
ASoC: cs35l41: Delete unnecessary condition in cs35l41_pcm_hw_params()
This code returns -EINVAL if "i" is out of bounds a few lines earlier. Delete this unnecessary check and pull the code in a tab. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/1ee32bfb-6f6c-4b61-887b-6f655abbfc47@moroto.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ab371a0 commit 181d58c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

sound/soc/codecs/cs35l41.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,9 @@ static int cs35l41_pcm_hw_params(struct snd_pcm_substream *substream,
772772

773773
asp_wl = params_width(params);
774774

775-
if (i < ARRAY_SIZE(cs35l41_fs_rates))
776-
regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL,
777-
CS35L41_GLOBAL_FS_MASK,
778-
cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT);
775+
regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL,
776+
CS35L41_GLOBAL_FS_MASK,
777+
cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT);
779778

780779
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
781780
regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT,

0 commit comments

Comments
 (0)