diff mbox series

ASoC: cs35l41: Delete unnecessary condition in cs35l41_pcm_hw_params()

Message ID 1ee32bfb-6f6c-4b61-887b-6f655abbfc47@moroto.mountain (mailing list archive)
State Accepted
Commit 181d58cfe90f6a2ad53f6811d318fbc7149df8c1
Headers show
Series ASoC: cs35l41: Delete unnecessary condition in cs35l41_pcm_hw_params() | expand

Commit Message

Dan Carpenter April 17, 2024, 9:52 a.m. UTC
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>
---
 sound/soc/codecs/cs35l41.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Mark Brown April 23, 2024, 9:11 a.m. UTC | #1
On Wed, 17 Apr 2024 12:52:34 +0300, Dan Carpenter wrote:
> 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.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cs35l41: Delete unnecessary condition in cs35l41_pcm_hw_params()
      commit: 181d58cfe90f6a2ad53f6811d318fbc7149df8c1

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c
index 2799ccd6b5c7..d3da6a9f7f2b 100644
--- a/sound/soc/codecs/cs35l41.c
+++ b/sound/soc/codecs/cs35l41.c
@@ -772,10 +772,9 @@  static int cs35l41_pcm_hw_params(struct snd_pcm_substream *substream,
 
 	asp_wl = params_width(params);
 
-	if (i < ARRAY_SIZE(cs35l41_fs_rates))
-		regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL,
-				   CS35L41_GLOBAL_FS_MASK,
-				   cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT);
+	regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL,
+			   CS35L41_GLOBAL_FS_MASK,
+			   cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT);
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT,