* [PATCH] drm: sti: Mark expected switch fall-throughs
@ 2019-07-29 22:27 Gustavo A. R. Silva
2019-07-30 9:37 ` Benjamin Gaignard
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 22:27 UTC (permalink / raw)
To: Benjamin Gaignard, Vincent Abriou, David Airlie, Daniel Vetter
Cc: dri-devel, linux-kernel, Gustavo A. R. Silva, Kees Cook
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning (Building: arm):
drivers/gpu/drm/sti/sti_hdmi.c: In function ‘hdmi_audio_configure’:
drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
audio_cfg |= HDMI_AUD_CFG_CH78_VALID;
drivers/gpu/drm/sti/sti_hdmi.c:852:2: note: here
case 6:
^~~~
drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
audio_cfg |= HDMI_AUD_CFG_CH56_VALID;
drivers/gpu/drm/sti/sti_hdmi.c:854:2: note: here
case 4:
^~~~
drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
audio_cfg |= HDMI_AUD_CFG_CH34_VALID | HDMI_AUD_CFG_8CH;
drivers/gpu/drm/sti/sti_hdmi.c:856:2: note: here
case 2:
^~~~
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/gpu/drm/sti/sti_hdmi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index f03d617edc4c..1617c5098a50 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -849,10 +849,13 @@ static int hdmi_audio_configure(struct sti_hdmi *hdmi)
switch (info->channels) {
case 8:
audio_cfg |= HDMI_AUD_CFG_CH78_VALID;
+ /* fall through */
case 6:
audio_cfg |= HDMI_AUD_CFG_CH56_VALID;
+ /* fall through */
case 4:
audio_cfg |= HDMI_AUD_CFG_CH34_VALID | HDMI_AUD_CFG_8CH;
+ /* fall through */
case 2:
audio_cfg |= HDMI_AUD_CFG_CH12_VALID;
break;
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm: sti: Mark expected switch fall-throughs
2019-07-29 22:27 [PATCH] drm: sti: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-07-30 9:37 ` Benjamin Gaignard
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Gaignard @ 2019-07-30 9:37 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Vincent Abriou, David Airlie, Daniel Vetter, ML dri-devel,
Linux Kernel Mailing List, Kees Cook
Le mar. 30 juil. 2019 à 00:27, Gustavo A. R. Silva
<gustavo@embeddedor.com> a écrit :
>
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning (Building: arm):
>
> drivers/gpu/drm/sti/sti_hdmi.c: In function ‘hdmi_audio_configure’:
> drivers/gpu/drm/sti/sti_hdmi.c:851:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
> audio_cfg |= HDMI_AUD_CFG_CH78_VALID;
> drivers/gpu/drm/sti/sti_hdmi.c:852:2: note: here
> case 6:
> ^~~~
> drivers/gpu/drm/sti/sti_hdmi.c:853:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
> audio_cfg |= HDMI_AUD_CFG_CH56_VALID;
> drivers/gpu/drm/sti/sti_hdmi.c:854:2: note: here
> case 4:
> ^~~~
> drivers/gpu/drm/sti/sti_hdmi.c:855:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
> audio_cfg |= HDMI_AUD_CFG_CH34_VALID | HDMI_AUD_CFG_8CH;
> drivers/gpu/drm/sti/sti_hdmi.c:856:2: note: here
> case 2:
> ^~~~
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied on drm-misc-next,
Thanks,
Benjamin
> ---
> drivers/gpu/drm/sti/sti_hdmi.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index f03d617edc4c..1617c5098a50 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -849,10 +849,13 @@ static int hdmi_audio_configure(struct sti_hdmi *hdmi)
> switch (info->channels) {
> case 8:
> audio_cfg |= HDMI_AUD_CFG_CH78_VALID;
> + /* fall through */
> case 6:
> audio_cfg |= HDMI_AUD_CFG_CH56_VALID;
> + /* fall through */
> case 4:
> audio_cfg |= HDMI_AUD_CFG_CH34_VALID | HDMI_AUD_CFG_8CH;
> + /* fall through */
> case 2:
> audio_cfg |= HDMI_AUD_CFG_CH12_VALID;
> break;
> --
> 2.22.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-30 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 22:27 [PATCH] drm: sti: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-30 9:37 ` Benjamin Gaignard
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).