linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs
@ 2018-08-01 19:47 Gustavo A. R. Silva
  2018-08-01 19:47 ` [PATCH 01/11] ASoC: wm8961: Mark expected switch fall-through Gustavo A. R. Silva
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:47 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches, Bard Liao, Oder Chiou
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, Gustavo A. R. Silva

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(+)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 01/11] ASoC: wm8961: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-08-01 19:47 ` Gustavo A. R. Silva
  2018-08-01 19:49 ` [PATCH 02/11] ASoC: rt5640: " Gustavo A. R. Silva
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:47 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, Gustavo A. R. Silva

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

Addresses-Coverity-ID: 1271173 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8961.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c
index f70f563..68b4cad 100644
--- a/sound/soc/codecs/wm8961.c
+++ b/sound/soc/codecs/wm8961.c
@@ -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) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 02/11] ASoC: rt5640: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
  2018-08-01 19:47 ` [PATCH 01/11] ASoC: wm8961: Mark expected switch fall-through Gustavo A. R. Silva
@ 2018-08-01 19:49 ` Gustavo A. R. Silva
  2018-08-01 19:50 ` [PATCH 03/11] ASoC: rt5677: " Gustavo A. R. Silva
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:49 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Jaroslav Kysela
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/rt5640.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 8bf8d36..2777014 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 03/11] ASoC: rt5677: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
  2018-08-01 19:47 ` [PATCH 01/11] ASoC: wm8961: Mark expected switch fall-through Gustavo A. R. Silva
  2018-08-01 19:49 ` [PATCH 02/11] ASoC: rt5640: " Gustavo A. R. Silva
@ 2018-08-01 19:50 ` Gustavo A. R. Silva
  2018-08-01 19:51 ` [PATCH 04/11] ASoC: wm8955: " Gustavo A. R. Silva
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:50 UTC (permalink / raw)
  To: Bard Liao, Oder Chiou, Liam Girdwood, Jaroslav Kysela
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/rt5677.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 8a0181a..922becf 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 04/11] ASoC: wm8955: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (2 preceding siblings ...)
  2018-08-01 19:50 ` [PATCH 03/11] ASoC: rt5677: " Gustavo A. R. Silva
@ 2018-08-01 19:51 ` Gustavo A. R. Silva
  2018-08-01 19:51 ` [PATCH 05/11] ASoC: wm8960: " Gustavo A. R. Silva
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:51 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8955.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
index ba44e3d..cd204f7 100644
--- a/sound/soc/codecs/wm8955.c
+++ b/sound/soc/codecs/wm8955.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 05/11] ASoC: wm8960: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (3 preceding siblings ...)
  2018-08-01 19:51 ` [PATCH 04/11] ASoC: wm8955: " Gustavo A. R. Silva
@ 2018-08-01 19:51 ` Gustavo A. R. Silva
  2018-08-01 19:52 ` [PATCH 06/11] ASoC: wm8904: " Gustavo A. R. Silva
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:51 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8960.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index c30f5aa..8dc1f3d 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -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));
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 06/11] ASoC: wm8904: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (4 preceding siblings ...)
  2018-08-01 19:51 ` [PATCH 05/11] ASoC: wm8960: " Gustavo A. R. Silva
@ 2018-08-01 19:52 ` Gustavo A. R. Silva
  2018-08-01 19:53 ` [PATCH 07/11] ASoC: wm8996: " Gustavo A. R. Silva
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:52 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8904.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 9037a35..1965635 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 07/11] ASoC: wm8996: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (5 preceding siblings ...)
  2018-08-01 19:52 ` [PATCH 06/11] ASoC: wm8904: " Gustavo A. R. Silva
@ 2018-08-01 19:53 ` Gustavo A. R. Silva
  2018-08-01 19:54 ` [PATCH 08/11] ASoC: wm8962: " Gustavo A. R. Silva
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:53 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8996.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index d9d2060..78a4082 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -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,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 08/11] ASoC: wm8962: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (6 preceding siblings ...)
  2018-08-01 19:53 ` [PATCH 07/11] ASoC: wm8996: " Gustavo A. R. Silva
@ 2018-08-01 19:54 ` Gustavo A. R. Silva
  2018-08-01 19:54 ` [PATCH 09/11] ASoC: wm8995: " Gustavo A. R. Silva
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:54 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8962.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index a11e9d6..efd8910 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -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;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 09/11] ASoC: wm8995: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (7 preceding siblings ...)
  2018-08-01 19:54 ` [PATCH 08/11] ASoC: wm8962: " Gustavo A. R. Silva
@ 2018-08-01 19:54 ` Gustavo A. R. Silva
  2018-08-01 19:55 ` [PATCH 10/11] ASoC: wm9081: " Gustavo A. R. Silva
  2018-08-01 19:56 ` [PATCH 11/11] ASoC: wm8994: " Gustavo A. R. Silva
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:54 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8995.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c
index 60e2278..68c99fe 100644
--- a/sound/soc/codecs/wm8995.c
+++ b/sound/soc/codecs/wm8995.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 10/11] ASoC: wm9081: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (8 preceding siblings ...)
  2018-08-01 19:54 ` [PATCH 09/11] ASoC: wm8995: " Gustavo A. R. Silva
@ 2018-08-01 19:55 ` Gustavo A. R. Silva
  2018-08-01 19:56 ` [PATCH 11/11] ASoC: wm8994: " Gustavo A. R. Silva
  10 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:55 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm9081.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index 5a0ea7b..399255d1 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
                   ` (9 preceding siblings ...)
  2018-08-01 19:55 ` [PATCH 10/11] ASoC: wm9081: " Gustavo A. R. Silva
@ 2018-08-01 19:56 ` Gustavo A. R. Silva
  2018-08-03 16:26   ` valdis.kletnieks
  10 siblings, 1 reply; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-01 19:56 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, patches
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Mark Brown, 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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/soc/codecs/wm8994.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 7fdfdf3..62f8c5b 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-01 19:56 ` [PATCH 11/11] ASoC: wm8994: " Gustavo A. R. Silva
@ 2018-08-03 16:26   ` valdis.kletnieks
  2018-08-03 16:41     ` Gustavo A. R. Silva
  0 siblings, 1 reply; 22+ messages in thread
From: valdis.kletnieks @ 2018-08-03 16:26 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Liam Girdwood, Jaroslav Kysela, patches, alsa-devel,
	linux-kernel, Takashi Iwai, Mark Brown

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

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

> diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
> index 7fdfdf3..62f8c5b 100644
> --- a/sound/soc/codecs/wm8994.c
> +++ b/sound/soc/codecs/wm8994.c
> @@ -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?



[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-03 16:26   ` valdis.kletnieks
@ 2018-08-03 16:41     ` Gustavo A. R. Silva
  2018-08-03 16:45       ` Mark Brown
  0 siblings, 1 reply; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-03 16:41 UTC (permalink / raw)
  To: valdis.kletnieks
  Cc: Liam Girdwood, Jaroslav Kysela, patches, alsa-devel,
	linux-kernel, Takashi Iwai, Mark Brown



On 08/03/2018 11:26 AM, valdis.kletnieks@vt.edu wrote:
> On Wed, 01 Aug 2018 14:56:16 -0500, "Gustavo A. R. Silva" said:
> 
>> diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
>> index 7fdfdf3..62f8c5b 100644
>> --- a/sound/soc/codecs/wm8994.c
>> +++ b/sound/soc/codecs/wm8994.c
>> @@ -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?
> 
> 

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-03 16:41     ` Gustavo A. R. Silva
@ 2018-08-03 16:45       ` Mark Brown
  2018-08-03 16:56         ` Gustavo A. R. Silva
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2018-08-03 16:45 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: valdis.kletnieks, Liam Girdwood, Jaroslav Kysela, patches,
	alsa-devel, linux-kernel, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

On Fri, Aug 03, 2018 at 11:41:39AM -0500, Gustavo A. R. Silva wrote:
> On 08/03/2018 11:26 AM, valdis.kletnieks@vt.edu 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-03 16:45       ` Mark Brown
@ 2018-08-03 16:56         ` Gustavo A. R. Silva
  2018-08-03 17:55           ` valdis.kletnieks
  0 siblings, 1 reply; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-03 16:56 UTC (permalink / raw)
  To: Mark Brown
  Cc: valdis.kletnieks, Liam Girdwood, Jaroslav Kysela, patches,
	alsa-devel, linux-kernel, Takashi Iwai



On 08/03/2018 11:45 AM, Mark Brown wrote:
> On Fri, Aug 03, 2018 at 11:41:39AM -0500, Gustavo A. R. Silva wrote:
>> On 08/03/2018 11:26 AM, valdis.kletnieks@vt.edu 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.
> 

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

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-03 16:56         ` Gustavo A. R. Silva
@ 2018-08-03 17:55           ` valdis.kletnieks
  2018-08-03 18:24             ` Gustavo A. R. Silva
  2018-08-06 11:34             ` Mark Brown
  0 siblings, 2 replies; 22+ messages in thread
From: valdis.kletnieks @ 2018-08-03 17:55 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, patches, alsa-devel,
	linux-kernel, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

On Fri, 03 Aug 2018 11:56:12 -0500, "Gustavo A. R. Silva" said:
> On 08/03/2018 11:45 AM, Mark Brown wrote:
> > 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? :)

> 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.

[-- Attachment #2: Type: application/pgp-signature, Size: 486 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-03 17:55           ` valdis.kletnieks
@ 2018-08-03 18:24             ` Gustavo A. R. Silva
  2018-08-06 11:34             ` Mark Brown
  1 sibling, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-03 18:24 UTC (permalink / raw)
  To: valdis.kletnieks
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, patches, alsa-devel,
	linux-kernel, Takashi Iwai



On 08/03/2018 12:55 PM, valdis.kletnieks@vt.edu wrote:
> On Fri, 03 Aug 2018 11:56:12 -0500, "Gustavo A. R. Silva" said:
>> On 08/03/2018 11:45 AM, Mark Brown wrote:
>>> 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? :)
> 
>> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-03 17:55           ` valdis.kletnieks
  2018-08-03 18:24             ` Gustavo A. R. Silva
@ 2018-08-06 11:34             ` Mark Brown
  2018-08-06 11:48               ` Gustavo A. R. Silva
  1 sibling, 1 reply; 22+ messages in thread
From: Mark Brown @ 2018-08-06 11:34 UTC (permalink / raw)
  To: valdis.kletnieks
  Cc: Gustavo A. R. Silva, Liam Girdwood, Jaroslav Kysela, patches,
	alsa-devel, linux-kernel, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

On Fri, Aug 03, 2018 at 01:55:18PM -0400, valdis.kletnieks@vt.edu wrote:
> On Fri, 03 Aug 2018 11:56:12 -0500, "Gustavo A. R. Silva" said:
> > On 08/03/2018 11:45 AM, Mark Brown wrote:
> > > 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.

> > 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-06 11:34             ` Mark Brown
@ 2018-08-06 11:48               ` Gustavo A. R. Silva
  2018-08-06 11:52                 ` Mark Brown
  0 siblings, 1 reply; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-06 11:48 UTC (permalink / raw)
  To: Mark Brown, valdis.kletnieks
  Cc: Liam Girdwood, Jaroslav Kysela, patches, alsa-devel,
	linux-kernel, Takashi Iwai



On 08/06/2018 06:34 AM, Mark Brown wrote:
> On Fri, Aug 03, 2018 at 01:55:18PM -0400, valdis.kletnieks@vt.edu wrote:
>> On Fri, 03 Aug 2018 11:56:12 -0500, "Gustavo A. R. Silva" said:
>>> On 08/03/2018 11:45 AM, Mark Brown wrote:
>>>> 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.
> 
>>> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-06 11:48               ` Gustavo A. R. Silva
@ 2018-08-06 11:52                 ` Mark Brown
  2018-08-06 11:59                   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 22+ messages in thread
From: Mark Brown @ 2018-08-06 11:52 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: valdis.kletnieks, Liam Girdwood, Jaroslav Kysela, patches,
	alsa-devel, linux-kernel, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

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.

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 11/11] ASoC: wm8994: Mark expected switch fall-through
  2018-08-06 11:52                 ` Mark Brown
@ 2018-08-06 11:59                   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 22+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-06 11:59 UTC (permalink / raw)
  To: Mark Brown
  Cc: valdis.kletnieks, Liam Girdwood, Jaroslav Kysela, patches,
	alsa-devel, linux-kernel, Takashi Iwai



On 08/06/2018 06:52 AM, Mark Brown wrote:
> 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.

>> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-08-06 11:59 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01 19:47 [PATCH 00/11] ASoC: codecs: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-08-01 19:47 ` [PATCH 01/11] ASoC: wm8961: Mark expected switch fall-through Gustavo A. R. Silva
2018-08-01 19:49 ` [PATCH 02/11] ASoC: rt5640: " Gustavo A. R. Silva
2018-08-01 19:50 ` [PATCH 03/11] ASoC: rt5677: " Gustavo A. R. Silva
2018-08-01 19:51 ` [PATCH 04/11] ASoC: wm8955: " Gustavo A. R. Silva
2018-08-01 19:51 ` [PATCH 05/11] ASoC: wm8960: " Gustavo A. R. Silva
2018-08-01 19:52 ` [PATCH 06/11] ASoC: wm8904: " Gustavo A. R. Silva
2018-08-01 19:53 ` [PATCH 07/11] ASoC: wm8996: " Gustavo A. R. Silva
2018-08-01 19:54 ` [PATCH 08/11] ASoC: wm8962: " Gustavo A. R. Silva
2018-08-01 19:54 ` [PATCH 09/11] ASoC: wm8995: " Gustavo A. R. Silva
2018-08-01 19:55 ` [PATCH 10/11] ASoC: wm9081: " Gustavo A. R. Silva
2018-08-01 19:56 ` [PATCH 11/11] ASoC: wm8994: " Gustavo A. R. Silva
2018-08-03 16:26   ` valdis.kletnieks
2018-08-03 16:41     ` Gustavo A. R. Silva
2018-08-03 16:45       ` Mark Brown
2018-08-03 16:56         ` Gustavo A. R. Silva
2018-08-03 17:55           ` valdis.kletnieks
2018-08-03 18:24             ` Gustavo A. R. Silva
2018-08-06 11:34             ` Mark Brown
2018-08-06 11:48               ` Gustavo A. R. Silva
2018-08-06 11:52                 ` Mark Brown
2018-08-06 11:59                   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).