ASoC: adau1761: Mark expected switch fall-though
diff mbox series

Message ID 20180808192213.GA27872@embeddedor.com
State New
Headers show
Series
  • ASoC: adau1761: Mark expected switch fall-though
Related show

Commit Message

Gustavo A. R. Silva Aug. 8, 2018, 7:22 p.m. UTC
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

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

Comments

Mark Brown Aug. 9, 2018, 9:31 a.m. UTC | #1
On Wed, Aug 08, 2018 at 02:22:13PM -0500, Gustavo A. R. Silva wrote:

> @@ -518,7 +518,8 @@ static int adau1761_setup_digmic_jackdetect(struct snd_soc_component *component)
>  			ARRAY_SIZE(adau1761_jack_detect_controls));
>  		if (ret)
>  			return ret;
> -	case ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE: /* fallthrough */
> +		/* fall through */
> +	case ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE:
>  		ret = snd_soc_dapm_add_routes(dapm, adau1761_no_dmic_routes,
>  			ARRAY_SIZE(adau1761_no_dmic_routes));
>  		if (ret)

Again, are you *sure* here?
Lars-Peter Clausen Aug. 9, 2018, 11:19 a.m. UTC | #2
On 08/09/2018 11:31 AM, Mark Brown wrote:
> On Wed, Aug 08, 2018 at 02:22:13PM -0500, Gustavo A. R. Silva wrote:
> 
>> @@ -518,7 +518,8 @@ static int adau1761_setup_digmic_jackdetect(struct snd_soc_component *component)
>>  			ARRAY_SIZE(adau1761_jack_detect_controls));
>>  		if (ret)
>>  			return ret;
>> -	case ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE: /* fallthrough */
>> +		/* fall through */
>> +	case ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE:
>>  		ret = snd_soc_dapm_add_routes(dapm, adau1761_no_dmic_routes,
>>  			ARRAY_SIZE(adau1761_no_dmic_routes));
>>  		if (ret)
> 
> Again, are you *sure* here?

Well, it says so in the comment next to it :)

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Patch
diff mbox series

diff --git a/sound/soc/codecs/adau1761.c b/sound/soc/codecs/adau1761.c
index be136e9..bef3e9e 100644
--- a/sound/soc/codecs/adau1761.c
+++ b/sound/soc/codecs/adau1761.c
@@ -518,7 +518,8 @@  static int adau1761_setup_digmic_jackdetect(struct snd_soc_component *component)
 			ARRAY_SIZE(adau1761_jack_detect_controls));
 		if (ret)
 			return ret;
-	case ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE: /* fallthrough */
+		/* fall through */
+	case ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE:
 		ret = snd_soc_dapm_add_routes(dapm, adau1761_no_dmic_routes,
 			ARRAY_SIZE(adau1761_no_dmic_routes));
 		if (ret)