Skip to contentSkip to conversation

ASoC: codecs: Mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 3 participants 33 messages Aug 1, 2018 – Aug 6, 2018

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

cover ASoC: codecs: Mark expected switch fall-throughs

Hi all,

In preparation to enabling -Wimplicit-fallthrough, this patchset aims to add some annotations in order to mark switch cases where we are expecting to fall through.

Thanks

Gustavo A. R. Silva (11):
ASoC: wm8961: Mark expected switch fall-through
ASoC: rt5640: Mark expected switch fall-through
ASoC: rt5677: Mark expected switch fall-through
ASoC: wm8955: Mark expected switch fall-through
ASoC: wm8960: Mark expected switch fall-through
ASoC: wm8904: Mark expected switch fall-through
ASoC: wm8996: Mark expected switch fall-through
ASoC: wm8962: Mark expected switch fall-through
ASoC: wm8995: Mark expected switch fall-through
ASoC: wm9081: Mark expected switch fall-through
ASoC: wm8994: Mark expected switch fall-through

 sound/soc/codecs/rt5640.c | 2 ++
 sound/soc/codecs/rt5677.c | 1 +
 sound/soc/codecs/wm8904.c | 1 +
 sound/soc/codecs/wm8955.c | 1 +
 sound/soc/codecs/wm8960.c | 1 +
 sound/soc/codecs/wm8961.c | 1 +
 sound/soc/codecs/wm8962.c | 1 +
 sound/soc/codecs/wm8994.c | 1 +
 sound/soc/codecs/wm8995.c | 1 +
 sound/soc/codecs/wm8996.c | 1 +
 sound/soc/codecs/wm9081.c | 1 +
 11 files changed, 12 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/11 ASoC: wm8961: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1271173 ("Missing break in switch")

---
 sound/soc/codecs/wm8961.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8961.c +1 -0
index f70f563..68b4cad 100644
@@ -653,6 +653,7 @@ static int wm8961_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 
 	case SND_SOC_DAIFMT_DSP_B:
 		aif |= WM8961_LRP;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif |= 3;
 		switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
Signature · 1 line
2.7.4
maintainer
#2 lore raw

Applied "ASoC: wm8961: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8961: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 9a73f6a235c2351adc07471519d4980e2fb33bbc Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:47:09 -0500
Subject: [PATCH] ASoC: wm8961: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1271173 ("Missing break in switch")

---
 sound/soc/codecs/wm8961.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8961.c +1 -0
index f70f563d59f3..68b4cadc308f 100644
@@ -653,6 +653,7 @@ static int wm8961_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 
 	case SND_SOC_DAIFMT_DSP_B:
 		aif |= WM8961_LRP;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif |= 3;
 		switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
Signature · 1 line
2.18.0
#3 lore raw

PATCH 2/11 ASoC: rt5640: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1056547 ("Missing break in switch")
Addresses-Coverity-ID: 1056548 ("Missing break in switch")

---
 sound/soc/codecs/rt5640.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/rt5640.c +2 -0
index 8bf8d36..2777014 100644
@@ -1665,6 +1665,7 @@ static int get_sdp_info(struct snd_soc_component *component, int dai_id)
 			break;
 		case RT5640_IF_113:
 			ret |= RT5640_U_IF1;
+			/* fall through */
 		case RT5640_IF_312:
 		case RT5640_IF_213:
 			ret |= RT5640_U_IF2;
@@ -1680,6 +1681,7 @@ static int get_sdp_info(struct snd_soc_component *component, int dai_id)
 			break;
 		case RT5640_IF_223:
 			ret |= RT5640_U_IF1;
+			/* fall through */
 		case RT5640_IF_123:
 		case RT5640_IF_321:
 			ret |= RT5640_U_IF2;
Signature · 1 line
2.7.4
maintainer
#4 lore raw

Applied "ASoC: rt5640: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: rt5640: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 065dcc270af66acb4226b49f635b41a054b663d4 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:49:13 -0500
Subject: [PATCH] ASoC: rt5640: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1056547 ("Missing break in switch")
Addresses-Coverity-ID: 1056548 ("Missing break in switch")

---
 sound/soc/codecs/rt5640.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/rt5640.c +2 -0
index 8bf8d360c25f..27770143ae8f 100644
@@ -1665,6 +1665,7 @@ static int get_sdp_info(struct snd_soc_component *component, int dai_id)
 			break;
 		case RT5640_IF_113:
 			ret |= RT5640_U_IF1;
+			/* fall through */
 		case RT5640_IF_312:
 		case RT5640_IF_213:
 			ret |= RT5640_U_IF2;
@@ -1680,6 +1681,7 @@ static int get_sdp_info(struct snd_soc_component *component, int dai_id)
 			break;
 		case RT5640_IF_223:
 			ret |= RT5640_U_IF1;
+			/* fall through */
 		case RT5640_IF_123:
 		case RT5640_IF_321:
 			ret |= RT5640_U_IF2;
Signature · 1 line
2.18.0
#5 lore raw

PATCH 3/11 ASoC: rt5677: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1271174 ("Missing break in switch")

---
 sound/soc/codecs/rt5677.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/rt5677.c +1 -0
index 8a0181a..922becf 100644
@@ -4417,6 +4417,7 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 		break;
 	case 25:
 		slot_width_25 = 0x8080;
+		/* fall through */
 	case 24:
 		val |= (2 << 8);
 		break;
Signature · 1 line
2.7.4
maintainer
#6 lore raw

Applied "ASoC: rt5677: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: rt5677: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 43a26bd026dab09a8b28c40e94ba534a52375b20 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:50:20 -0500
Subject: [PATCH] ASoC: rt5677: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1271174 ("Missing break in switch")

---
 sound/soc/codecs/rt5677.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/rt5677.c +1 -0
index 8a0181a2db08..922becfee59b 100644
@@ -4417,6 +4417,7 @@ static int rt5677_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
 		break;
 	case 25:
 		slot_width_25 = 0x8080;
+		/* fall through */
 	case 24:
 		val |= (2 << 8);
 		break;
Signature · 1 line
2.18.0
#7 lore raw

PATCH 4/11 ASoC: wm8955: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115047 ("Missing break in switch")

---
 sound/soc/codecs/wm8955.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8955.c +1 -0
index ba44e3d..cd204f7 100644
@@ -686,6 +686,7 @@ static int wm8955_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif |= WM8955_LRP;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif |= 0x3;
 		break;
Signature · 1 line
2.7.4
maintainer
#8 lore raw

Applied "ASoC: wm8955: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8955: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 85e7e77079f3201799467803f6c8533a9921e32d Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:51:18 -0500
Subject: [PATCH] ASoC: wm8955: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115047 ("Missing break in switch")

---
 sound/soc/codecs/wm8955.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8955.c +1 -0
index ba44e3d6c1e0..cd204f79647d 100644
@@ -686,6 +686,7 @@ static int wm8955_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif |= WM8955_LRP;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif |= 0x3;
 		break;
Signature · 1 line
2.18.0
#9 lore raw

PATCH 5/11 ASoC: wm8960: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115041 ("Missing break in switch")

---
 sound/soc/codecs/wm8960.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8960.c +1 -0
index c30f5aa..8dc1f3d 100644
@@ -839,6 +839,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
 			iface |= 0x000c;
 			break;
 		}
+		/* fall through */
 	default:
 		dev_err(component->dev, "unsupported width %d\n",
 			params_width(params));
Signature · 1 line
2.7.4
maintainer
#10 lore raw

Applied "ASoC: wm8960: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8960: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 3eb7dbc6d844d2033271434d02ff90ac9b19e393 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:51:59 -0500
Subject: [PATCH] ASoC: wm8960: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115041 ("Missing break in switch")

---
 sound/soc/codecs/wm8960.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8960.c +1 -0
index c30f5aa392c6..8dc1f3d6a988 100644
@@ -839,6 +839,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
 			iface |= 0x000c;
 			break;
 		}
+		/* fall through */
 	default:
 		dev_err(component->dev, "unsupported width %d\n",
 			params_width(params));
Signature · 1 line
2.18.0
#11 lore raw

PATCH 6/11 ASoC: wm8904: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115042 ("Missing break in switch")

---
 sound/soc/codecs/wm8904.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8904.c +1 -0
index 9037a35..1965635 100644
@@ -1455,6 +1455,7 @@ static int wm8904_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif1 |= 0x3 | WM8904_AIF_LRCLK_INV;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif1 |= 0x3;
 		break;
Signature · 1 line
2.7.4
maintainer
#12 lore raw

Applied "ASoC: wm8904: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8904: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 da41787b9f319a7a23fcc8cf65c6ad646803962e Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:52:41 -0500
Subject: [PATCH] ASoC: wm8904: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115042 ("Missing break in switch")

---
 sound/soc/codecs/wm8904.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8904.c +1 -0
index 9037a35b931d..1965635ec07c 100644
@@ -1455,6 +1455,7 @@ static int wm8904_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif1 |= 0x3 | WM8904_AIF_LRCLK_INV;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif1 |= 0x3;
 		break;
Signature · 1 line
2.18.0
#13 lore raw

PATCH 7/11 ASoC: wm8996: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 146354 ("Missing break in switch")

---
 sound/soc/codecs/wm8996.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8996.c +1 -0
index d9d2060..78a4082 100644
@@ -1858,6 +1858,7 @@ static int wm8996_set_sysclk(struct snd_soc_dai *dai,
 	case 24576000:
 		ratediv = WM8996_SYSCLK_DIV;
 		wm8996->sysclk /= 2;
+		/* fall through */
 	case 11289600:
 	case 12288000:
 		snd_soc_component_update_bits(component, WM8996_AIF_RATE,
Signature · 1 line
2.7.4
maintainer
#14 lore raw

Applied "ASoC: wm8996: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8996: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 42ef3c94ff6e8315377c04504f1bce50d1f21738 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:53:19 -0500
Subject: [PATCH] ASoC: wm8996: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 146354 ("Missing break in switch")

---
 sound/soc/codecs/wm8996.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8996.c +1 -0
index d9d206046f8c..78a408236cfb 100644
@@ -1858,6 +1858,7 @@ static int wm8996_set_sysclk(struct snd_soc_dai *dai,
 	case 24576000:
 		ratediv = WM8996_SYSCLK_DIV;
 		wm8996->sysclk /= 2;
+		/* fall through */
 	case 11289600:
 	case 12288000:
 		snd_soc_component_update_bits(component, WM8996_AIF_RATE,
Signature · 1 line
2.18.0
#15 lore raw

PATCH 8/11 ASoC: wm8962: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115043 ("Missing break in switch")

---
 sound/soc/codecs/wm8962.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8962.c +1 -0
index a11e9d6..efd8910 100644
@@ -2649,6 +2649,7 @@ static int wm8962_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif0 |= WM8962_LRCLK_INV | 3;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif0 |= 3;
 
Signature · 1 line
2.7.4
maintainer
#16 lore raw

Applied "ASoC: wm8962: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8962: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 a9531ab151117e976544e0dc74a9bc8cbd01145f Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:54:03 -0500
Subject: [PATCH] ASoC: wm8962: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115043 ("Missing break in switch")

---
 sound/soc/codecs/wm8962.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8962.c +1 -0
index a11e9d6bf950..efd8910b1ff7 100644
@@ -2649,6 +2649,7 @@ static int wm8962_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif0 |= WM8962_LRCLK_INV | 3;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif0 |= 3;
 
Signature · 1 line
2.18.0
#17 lore raw

PATCH 9/11 ASoC: wm8995: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115045 ("Missing break in switch")

---
 sound/soc/codecs/wm8995.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8995.c +1 -0
index 60e2278..68c99fe 100644
@@ -1465,6 +1465,7 @@ static int wm8995_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif |= WM8995_AIF1_LRCLK_INV;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif |= (0x3 << WM8995_AIF1_FMT_SHIFT);
 		break;
Signature · 1 line
2.7.4
maintainer
#18 lore raw

Applied "ASoC: wm8995: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8995: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 af5d1d5d4ba71164711025e077511ad48d5690e9 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:54:45 -0500
Subject: [PATCH] ASoC: wm8995: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115045 ("Missing break in switch")

---
 sound/soc/codecs/wm8995.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8995.c +1 -0
index 60e227832331..68c99fe37097 100644
@@ -1465,6 +1465,7 @@ static int wm8995_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif |= WM8995_AIF1_LRCLK_INV;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif |= (0x3 << WM8995_AIF1_FMT_SHIFT);
 		break;
Signature · 1 line
2.18.0
#19 lore raw

PATCH 10/11 ASoC: wm9081: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1357430 ("Missing break in switch")

---
 sound/soc/codecs/wm9081.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm9081.c +1 -0
index 5a0ea7b..399255d1 100644
@@ -933,6 +933,7 @@ static int wm9081_set_dai_fmt(struct snd_soc_dai *dai,
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif2 |= WM9081_AIF_LRCLK_INV;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif2 |= 0x3;
 		break;
Signature · 1 line
2.7.4
maintainer
#20 lore raw

Applied "ASoC: wm9081: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm9081: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 7a2235ef507822679ac89007a6a37b23f30eed56 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:55:26 -0500
Subject: [PATCH] ASoC: wm9081: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 1357430 ("Missing break in switch")

---
 sound/soc/codecs/wm9081.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm9081.c +1 -0
index 5a0ea7b3c149..399255d1f78a 100644
@@ -933,6 +933,7 @@ static int wm9081_set_dai_fmt(struct snd_soc_dai *dai,
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_DSP_B:
 		aif2 |= WM9081_AIF_LRCLK_INV;
+		/* fall through */
 	case SND_SOC_DAIFMT_DSP_A:
 		aif2 |= 0x3;
 		break;
Signature · 1 line
2.18.0
#21 lore raw

PATCH 11/11 ASoC: wm8994: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115050 ("Missing break in switch")

---
 sound/soc/codecs/wm8994.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8994.c +1 -0
index 7fdfdf3..62f8c5b 100644
@@ -2432,6 +2432,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
 			snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2,
 					    WM8994_OPCLK_ENA, 0);
 		}
+		/* fall through */
 
 	default:
 		return -EINVAL;
Signature · 1 line
2.7.4
maintainer
#22 lore raw

Applied "ASoC: wm8994: Mark expected switch fall-through" to the asoc tree

The patch

ASoC: wm8994: Mark expected switch fall-through

has been applied to the asoc tree at

https://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 2cea1542859bc812f1ec51ea71c06e927e5b922e Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 1 Aug 2018 14:56:16 -0500
Subject: [PATCH] ASoC: wm8994: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 115050 ("Missing break in switch")

---
 sound/soc/codecs/wm8994.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/wm8994.c +1 -0
index 7fdfdf3f6e67..62f8c5b9ba92 100644
@@ -2432,6 +2432,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
 			snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2,
 					    WM8994_OPCLK_ENA, 0);
 		}
+		/* fall through */
 
 	default:
 		return -EINVAL;
Signature · 1 line
2.18.0
#23 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

In reply to Gustavo A. R. Silva

sound/soc/codecs/wm8994.c static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, · line 2438

Quoted 12 lines · Gustavo A. R. Silva
sound/soc/codecs/wm8994.c +1 -0
index 7fdfdf3..62f8c5b 100644
@@ -2432,6 +2432,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
 			snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2,
 					    WM8994_OPCLK_ENA, 0);
 		}
+		/* fall through */
 
 	default:
 		return -EINVAL;

Wait, what? This looks like the sort of bug -Wimplicit-fallthrough is supposed to catch. Unless for 'case WM8994_SYSCLK_OPCLK:' we actually do want to do a whole bunch of snd_soc_component_update_bits() calls and then return -EINVAL whether or not that case succeeded?

#24 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 12 lines · On 08/03/2018 11:26 AM, [email protected] wrote:
Quoted 10 lines · Gustavo A. R. Silva
sound/soc/codecs/wm8994.c +1 -0
index 7fdfdf3..62f8c5b 100644
@@ -2432,6 +2432,7 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
 			snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2,
 					    WM8994_OPCLK_ENA, 0);
 		}
+		/* fall through */
 
Quoted 9 lines

sound/soc/codecs/wm8994.c static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai, · line 2438

Quoted 2 lines
sound/soc/codecs/wm8994.c +0 -0
 	default:
 		return -EINVAL;

Wait, what? This looks like the sort of bug -Wimplicit-fallthrough is supposed to catch. Unless for 'case WM8994_SYSCLK_OPCLK:' we actually do want to do a whole bunch of snd_soc_component_update_bits() calls and then return -EINVAL whether or not that case succeeded?

Yeah, it seems like a bug. Can someone confirm this?

Notice that this code has been there since 2010.

Thanks Valdis for pointing this out.
--
Gustavo

maintainer
#25 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 11 lines · Gustavo A. R. Silva
Quoted 6 lines · On 08/03/2018 11:26 AM, [email protected] wrote:

On Wed, 01 Aug 2018 14:56:16 -0500, "Gustavo A. R. Silva" said:

Wait, what? This looks like the sort of bug -Wimplicit-fallthrough is supposed to catch. Unless for 'case WM8994_SYSCLK_OPCLK:' we actually do want to do a whole bunch of snd_soc_component_update_bits() calls and then return -EINVAL whether or not that case succeeded?

Yeah, it seems like a bug. Can someone confirm this?

Notice that this code has been there since 2010.

Basically nobody ever uses OPCLK so I'd be susprised if anyone ever noticed.

#26 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 9 lines · Mark Brown
Quoted 7 lines · Gustavo A. R. Silva
Quoted 6 lines · On 08/03/2018 11:26 AM, [email protected] wrote:

On Wed, 01 Aug 2018 14:56:16 -0500, "Gustavo A. R. Silva" said:

Wait, what? This looks like the sort of bug -Wimplicit-fallthrough is supposed to catch. Unless for 'case WM8994_SYSCLK_OPCLK:' we actually do want to do a whole bunch of snd_soc_component_update_bits() calls and then return -EINVAL whether or not that case succeeded?

Quoted 7 lines
Quoted 3 lines

Yeah, it seems like a bug. Can someone confirm this?

Notice that this code has been there since 2010.

Basically nobody ever uses OPCLK so I'd be susprised if anyone ever noticed.

I see. I wonder what's the best approach in this case. Should that code be removed instead of 'fixed'?

Thanks
--
Gustavo

#27 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 3 lines · Gustavo A. R. Silva
Quoted 2 lines · Mark Brown

Basically nobody ever uses OPCLK so I'd be susprised if anyone ever noticed.

I wonder if nobody uses it because any attempts to do so get an error? :)

Quoted 2 lines

I see. I wonder what's the best approach in this case. Should that code be removed instead of 'fixed'?

I'm thinking that's a spot that needs a 'break;' added.

Of course, my understanding of that code is limited to looking at the first 10 patches and the fall-through hit something reasonable, and then the last one did a fall-through to an error return.

#28 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 5 lines · On 08/03/2018 12:55 PM, [email protected] wrote:
Quoted 3 lines · Gustavo A. R. Silva
Quoted 2 lines · Mark Brown

Basically nobody ever uses OPCLK so I'd be susprised if anyone ever noticed.

Quoted 7 lines

I wonder if nobody uses it because any attempts to do so get an error? :)

Quoted 2 lines

I see. I wonder what's the best approach in this case. Should that code be removed instead of 'fixed'?

I'm thinking that's a spot that needs a 'break;' added.

Yep. And I think the patch to fix this should be tagged for stable.

So, it seems we have two options:

1. Revert commit 2cea1542859bc812f1ec51ea71c06e927e5b922e and then apply a fix with the break statement.

or

2. Apply a fix with the break statement and then backport the fix to stable.

am I correct?

Thanks
--
Gustavo

maintainer
#29 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

In reply to [email protected]
Quoted 6 lines · On Fri, Aug 03, 2018 at 01:55:18PM -0400, [email protected] wrote:
Quoted 3 lines · Gustavo A. R. Silva
Quoted 2 lines · Mark Brown

Basically nobody ever uses OPCLK so I'd be susprised if anyone ever noticed.

I wonder if nobody uses it because any attempts to do so get an error? :)

No, nobody ever physically wires up an OPCLK. If one was there it'd be unavoidable.

Quoted 4 lines
Quoted 2 lines

I see. I wonder what's the best approach in this case. Should that code be removed instead of 'fixed'?

I'm thinking that's a spot that needs a 'break;' added.

Yes.

#30 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 11 lines · Mark Brown
Quoted 6 lines · On Fri, Aug 03, 2018 at 01:55:18PM -0400, [email protected] wrote:
Quoted 3 lines · Gustavo A. R. Silva
Quoted 2 lines · Mark Brown

Basically nobody ever uses OPCLK so I'd be susprised if anyone ever noticed.

I wonder if nobody uses it because any attempts to do so get an error? :)

No, nobody ever physically wires up an OPCLK. If one was there it'd be unavoidable.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

I see. I wonder what's the best approach in this case. Should that code be removed instead of 'fixed'?

I'm thinking that's a spot that needs a 'break;' added.

Yes.

OK. I'll send a patch for this. But I wonder what's the best approach in this case, so the fix can also be applied to stable.

Thanks
--
Gustavo

maintainer
#31 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

On Mon, Aug 06, 2018 at 06:48:13AM -0500, Gustavo A. R. Silva wrote:

Please fix your mail client to word wrap within paragraphs at something substantially less than 80 columns. Doing this makes your messages much easier to read and reply to.

Quoted 2 lines

OK. I'll send a patch for this. But I wonder what's the best approach in this case, so the fix can also be applied to stable.

Just send a patch, a fixup can be done when the backport fails.

#32 lore raw

Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through

Quoted 6 lines · Mark Brown

On Mon, Aug 06, 2018 at 06:48:13AM -0500, Gustavo A. R. Silva wrote:

Please fix your mail client to word wrap within paragraphs at something substantially less than 80 columns. Doing this makes your messages much easier to read and reply to.

Sure thing.

Quoted 5 lines
Quoted 2 lines

OK. I'll send a patch for this. But I wonder what's the best approach in this case, so the fix can also be applied to stable.

Just send a patch, a fixup can be done when the backport fails.

I got it.

I'll send the patch and I'll take care of the backport when the time comes.

Thanks
--
Gustavo