All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
@ 2021-05-28 20:20 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2021-05-28 20:20 UTC (permalink / raw)
  To: Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel, Gustavo A. R. Silva, linux-hardening

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a goto statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
JFYI: We had thousands of these sorts of warnings and now we are down
      to just 25 in linux-next. This is one of those last remaining
      warnings.

 sound/soc/ti/davinci-mcasp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index b94220306d1a..587967720135 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2317,6 +2317,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 		break;
 	default:
 		dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
+		goto err;
 	case -EPROBE_DEFER:
 		goto err;
 	}
-- 
2.27.0


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

* [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
@ 2021-05-28 20:20 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2021-05-28 20:20 UTC (permalink / raw)
  To: Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-hardening, linux-kernel, Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a goto statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
JFYI: We had thousands of these sorts of warnings and now we are down
      to just 25 in linux-next. This is one of those last remaining
      warnings.

 sound/soc/ti/davinci-mcasp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index b94220306d1a..587967720135 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2317,6 +2317,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 		break;
 	default:
 		dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
+		goto err;
 	case -EPROBE_DEFER:
 		goto err;
 	}
-- 
2.27.0


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

* Re: [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
  2021-05-28 20:20 ` Gustavo A. R. Silva
@ 2021-06-01 19:20   ` Kees Cook
  -1 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2021-06-01 19:20 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel, linux-hardening

On Fri, May 28, 2021 at 03:20:47PM -0500, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
> by explicitly adding a goto statement instead of letting the code fall
> through to the next case.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

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

* Re: [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
@ 2021-06-01 19:20   ` Kees Cook
  0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2021-06-01 19:20 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
	Mark Brown, linux-hardening, Peter Ujfalusi

On Fri, May 28, 2021 at 03:20:47PM -0500, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
> by explicitly adding a goto statement instead of letting the code fall
> through to the next case.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

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

* Re: [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
  2021-05-28 20:20 ` Gustavo A. R. Silva
  (?)
  (?)
@ 2021-06-04  7:14 ` Péter Ujfalusi
  2021-06-04  7:29   ` Gustavo A. R. Silva
  -1 siblings, 1 reply; 6+ messages in thread
From: Péter Ujfalusi @ 2021-06-04  7:14 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: alsa-devel, linux-kernel, linux-hardening



On 28/05/2021 23:20, Gustavo A. R. Silva wrote:
> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
> by explicitly adding a goto statement instead of letting the code fall
> through to the next case.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> JFYI: We had thousands of these sorts of warnings and now we are down
>       to just 25 in linux-next. This is one of those last remaining
>       warnings.
> 
>  sound/soc/ti/davinci-mcasp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index b94220306d1a..587967720135 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -2317,6 +2317,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
>  		break;
>  	default:
>  		dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
> +		goto err;

Would:
	fallthrough;

be enough to silence the warning? If so, then I would prefer this version.

>  	case -EPROBE_DEFER:
>  		goto err;
>  	}
> 

-- 
Péter

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

* Re: [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang
  2021-06-04  7:14 ` Péter Ujfalusi
@ 2021-06-04  7:29   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2021-06-04  7:29 UTC (permalink / raw)
  To: Péter Ujfalusi, Gustavo A. R. Silva, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel, linux-hardening



On 6/4/21 02:14, Péter Ujfalusi wrote:
> 
> 
> On 28/05/2021 23:20, Gustavo A. R. Silva wrote:
>> In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
>> by explicitly adding a goto statement instead of letting the code fall
>> through to the next case.
>>
>> Link: https://github.com/KSPP/linux/issues/115
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> ---
>> JFYI: We had thousands of these sorts of warnings and now we are down
>>       to just 25 in linux-next. This is one of those last remaining
>>       warnings.
>>
>>  sound/soc/ti/davinci-mcasp.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
>> index b94220306d1a..587967720135 100644
>> --- a/sound/soc/ti/davinci-mcasp.c
>> +++ b/sound/soc/ti/davinci-mcasp.c
>> @@ -2317,6 +2317,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
>>  		break;
>>  	default:
>>  		dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
>> +		goto err;
> 
> Would:
> 	fallthrough;
> 
> be enough to silence the warning? If so, then I would prefer this version.

Yep.:) Done:

	https://lore.kernel.org/linux-hardening/20210604072714.GA244640@embeddedor/

Thanks
--
Gustavo

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

end of thread, other threads:[~2021-06-04  7:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 20:20 [PATCH][next] ASoC: ti: davinci-mcasp: Fix fall-through warning for Clang Gustavo A. R. Silva
2021-05-28 20:20 ` Gustavo A. R. Silva
2021-06-01 19:20 ` Kees Cook
2021-06-01 19:20   ` Kees Cook
2021-06-04  7:14 ` Péter Ujfalusi
2021-06-04  7:29   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.