Skip to contentSkip to conversation

Changed the if-else case to switch case

PATCH In review anish kumar 2 participants 2 messages Feb 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Changed the if-else case to switch case

---
 sound/soc/codecs/max9867.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
sound/soc/codecs/max9867.c +12 -6
index b9d989f..5a8481b 100755
@@ -212,16 +212,22 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
 		switch (snd_pcm_format_width(params_format(params))) {
 		case 8:
 		case 16:
-			if (pclk_bclk_ratio == 2)
+			switch (pclk_bclk_ratio) {
+			case 2:
 				bclk_value = MAX9867_IFC1B_PCLK_2;
-			else if (pclk_bclk_ratio == 4)
+				break;
+			case 4:
 				bclk_value = MAX9867_IFC1B_PCLK_4;
-			else if (pclk_bclk_ratio == 8)
+				break;
+			case 8:
 				bclk_value = MAX9867_IFC1B_PCLK_8;
-			else if (pclk_bclk_ratio == 16)
+				break;
+			case 16:
 				bclk_value = MAX9867_IFC1B_PCLK_16;
-			else {
-				dev_err(codec->dev, "unsupported sampling rate\n");
+				break;
+			default:
+				dev_err(codec->dev,
+					"unsupported sampling rate\n");
 				return -EINVAL;
 			}
 			break;
Signature · 1 line
1.9.3
maintainer
#1 lore raw

Applied "ASoC: max9867: Changed the if-else case to switch case" to the asoc tree

The patch

ASoC: max9867: Changed the if-else case to switch case

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

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

Quoted 1 line

From b14614502908beb5d898a665b40cfa91ad237f93 Mon Sep 17 00:00:00 2001

From: anish kumar <[email protected]>
Date: Thu, 18 Feb 2016 10:36:20 -0800
Subject: [PATCH] ASoC: max9867: Changed the if-else case to switch case

---
 sound/soc/codecs/max9867.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
sound/soc/codecs/max9867.c +12 -6
index b9d989f25515..5a8481bf20c2 100755
@@ -212,16 +212,22 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
 		switch (snd_pcm_format_width(params_format(params))) {
 		case 8:
 		case 16:
-			if (pclk_bclk_ratio == 2)
+			switch (pclk_bclk_ratio) {
+			case 2:
 				bclk_value = MAX9867_IFC1B_PCLK_2;
-			else if (pclk_bclk_ratio == 4)
+				break;
+			case 4:
 				bclk_value = MAX9867_IFC1B_PCLK_4;
-			else if (pclk_bclk_ratio == 8)
+				break;
+			case 8:
 				bclk_value = MAX9867_IFC1B_PCLK_8;
-			else if (pclk_bclk_ratio == 16)
+				break;
+			case 16:
 				bclk_value = MAX9867_IFC1B_PCLK_16;
-			else {
-				dev_err(codec->dev, "unsupported sampling rate\n");
+				break;
+			default:
+				dev_err(codec->dev,
+					"unsupported sampling rate\n");
 				return -EINVAL;
 			}
 			break;
Signature · 1 line
2.7.0