linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sound: dmasound_atari: Mark expected switch fall-through
@ 2019-07-29 14:33 Gustavo A. R. Silva
  2019-07-29 15:35 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 14:33 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel, Gustavo A. R. Silva,
	Geert Uytterhoeven, Kees Cook

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

sound/oss/dmasound/dmasound_atari.c: warning: this statement may fall
through [-Wimplicit-fallthrough=]:  => 1449:24

Notice that, in this particular case, the code comment is
modified in accordance with what GCC is expecting to find.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/oss/dmasound/dmasound_atari.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
index 83653683fd68..b5845e904ba1 100644
--- a/sound/oss/dmasound/dmasound_atari.c
+++ b/sound/oss/dmasound/dmasound_atari.c
@@ -1449,7 +1449,7 @@ static int FalconMixerIoctl(u_int cmd, u_long arg)
 		tt_dmasnd.input_gain =
 			RECLEVEL_VOXWARE_TO_GAIN(data & 0xff) << 4 |
 			RECLEVEL_VOXWARE_TO_GAIN(data >> 8 & 0xff);
-		/* fall thru, return set value */
+		/* fall through - return set value */
 	    case SOUND_MIXER_READ_MIC:
 		return IOCTL_OUT(arg,
 			RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain >> 4 & 0xf) |
-- 
2.22.0


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

* Re: [PATCH] sound: dmasound_atari: Mark expected switch fall-through
  2019-07-29 14:33 [PATCH] sound: dmasound_atari: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-07-29 15:35 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2019-07-29 15:35 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jaroslav Kysela, Takashi Iwai, ALSA Development Mailing List,
	Linux Kernel Mailing List, Kees Cook, linux-m68k

Hi Gustavo,

Thanks for your patch!

On Mon, Jul 29, 2019 at 4:33 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning:
>
> sound/oss/dmasound/dmasound_atari.c: warning: this statement may fall
> through [-Wimplicit-fallthrough=]:  => 1449:24
>
> Notice that, in this particular case, the code comment is
> modified in accordance with what GCC is expecting to find.

Have you compile-tested this?

This doesn't work with gcc version 8.2.0 (Ubuntu 8.2.0-1ubuntu2~18.04).
Turns out the warning only goes away when converting the indentation
of the switch() statement to match kernel style... Silly gcc...

> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  sound/oss/dmasound/dmasound_atari.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
> index 83653683fd68..b5845e904ba1 100644
> --- a/sound/oss/dmasound/dmasound_atari.c
> +++ b/sound/oss/dmasound/dmasound_atari.c
> @@ -1449,7 +1449,7 @@ static int FalconMixerIoctl(u_int cmd, u_long arg)
>                 tt_dmasnd.input_gain =
>                         RECLEVEL_VOXWARE_TO_GAIN(data & 0xff) << 4 |
>                         RECLEVEL_VOXWARE_TO_GAIN(data >> 8 & 0xff);
> -               /* fall thru, return set value */
> +               /* fall through - return set value */
>             case SOUND_MIXER_READ_MIC:
>                 return IOCTL_OUT(arg,
>                         RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain >> 4 & 0xf) |

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2019-07-29 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 14:33 [PATCH] sound: dmasound_atari: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-29 15:35 ` Geert Uytterhoeven

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