* [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through
@ 2019-07-29 20:54 Gustavo A. R. Silva
2019-07-29 21:48 ` Kees Cook
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 20:54 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 (Building: m68k):
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>
---
Changes in v2:
- Update code so switch and case statements are at the same indent.
sound/oss/dmasound/dmasound_atari.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
index 83653683fd68..823ccfa089b2 100644
--- a/sound/oss/dmasound/dmasound_atari.c
+++ b/sound/oss/dmasound/dmasound_atari.c
@@ -1432,25 +1432,25 @@ static int FalconMixerIoctl(u_int cmd, u_long arg)
{
int data;
switch (cmd) {
- case SOUND_MIXER_READ_RECMASK:
+ case SOUND_MIXER_READ_RECMASK:
return IOCTL_OUT(arg, SOUND_MASK_MIC);
- case SOUND_MIXER_READ_DEVMASK:
+ case SOUND_MIXER_READ_DEVMASK:
return IOCTL_OUT(arg, SOUND_MASK_VOLUME | SOUND_MASK_MIC | SOUND_MASK_SPEAKER);
- case SOUND_MIXER_READ_STEREODEVS:
+ case SOUND_MIXER_READ_STEREODEVS:
return IOCTL_OUT(arg, SOUND_MASK_VOLUME | SOUND_MASK_MIC);
- case SOUND_MIXER_READ_VOLUME:
+ case SOUND_MIXER_READ_VOLUME:
return IOCTL_OUT(arg,
VOLUME_ATT_TO_VOXWARE(dmasound.volume_left) |
VOLUME_ATT_TO_VOXWARE(dmasound.volume_right) << 8);
- case SOUND_MIXER_READ_CAPS:
+ case SOUND_MIXER_READ_CAPS:
return IOCTL_OUT(arg, SOUND_CAP_EXCL_INPUT);
- case SOUND_MIXER_WRITE_MIC:
+ case SOUND_MIXER_WRITE_MIC:
IOCTL_IN(arg, data);
tt_dmasnd.input_gain =
RECLEVEL_VOXWARE_TO_GAIN(data & 0xff) << 4 |
RECLEVEL_VOXWARE_TO_GAIN(data >> 8 & 0xff);
- /* fall thru, return set value */
- case SOUND_MIXER_READ_MIC:
+ /* fall through - return set value */
+ case SOUND_MIXER_READ_MIC:
return IOCTL_OUT(arg,
RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain >> 4 & 0xf) |
RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain & 0xf) << 8);
--
2.22.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through
2019-07-29 20:54 [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-07-29 21:48 ` Kees Cook
2019-07-30 7:05 ` Geert Uytterhoeven
2019-07-30 7:36 ` Takashi Iwai
2 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2019-07-29 21:48 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
Geert Uytterhoeven
On Mon, Jul 29, 2019 at 03:54:54PM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning (Building: m68k):
>
> 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>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> Changes in v2:
> - Update code so switch and case statements are at the same indent.
>
> sound/oss/dmasound/dmasound_atari.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
> index 83653683fd68..823ccfa089b2 100644
> --- a/sound/oss/dmasound/dmasound_atari.c
> +++ b/sound/oss/dmasound/dmasound_atari.c
> @@ -1432,25 +1432,25 @@ static int FalconMixerIoctl(u_int cmd, u_long arg)
> {
> int data;
> switch (cmd) {
> - case SOUND_MIXER_READ_RECMASK:
> + case SOUND_MIXER_READ_RECMASK:
> return IOCTL_OUT(arg, SOUND_MASK_MIC);
> - case SOUND_MIXER_READ_DEVMASK:
> + case SOUND_MIXER_READ_DEVMASK:
> return IOCTL_OUT(arg, SOUND_MASK_VOLUME | SOUND_MASK_MIC | SOUND_MASK_SPEAKER);
> - case SOUND_MIXER_READ_STEREODEVS:
> + case SOUND_MIXER_READ_STEREODEVS:
> return IOCTL_OUT(arg, SOUND_MASK_VOLUME | SOUND_MASK_MIC);
> - case SOUND_MIXER_READ_VOLUME:
> + case SOUND_MIXER_READ_VOLUME:
> return IOCTL_OUT(arg,
> VOLUME_ATT_TO_VOXWARE(dmasound.volume_left) |
> VOLUME_ATT_TO_VOXWARE(dmasound.volume_right) << 8);
> - case SOUND_MIXER_READ_CAPS:
> + case SOUND_MIXER_READ_CAPS:
> return IOCTL_OUT(arg, SOUND_CAP_EXCL_INPUT);
> - case SOUND_MIXER_WRITE_MIC:
> + case SOUND_MIXER_WRITE_MIC:
> IOCTL_IN(arg, data);
> tt_dmasnd.input_gain =
> RECLEVEL_VOXWARE_TO_GAIN(data & 0xff) << 4 |
> RECLEVEL_VOXWARE_TO_GAIN(data >> 8 & 0xff);
> - /* fall thru, return set value */
> - case SOUND_MIXER_READ_MIC:
> + /* fall through - return set value */
> + case SOUND_MIXER_READ_MIC:
> return IOCTL_OUT(arg,
> RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain >> 4 & 0xf) |
> RECLEVEL_GAIN_TO_VOXWARE(tt_dmasnd.input_gain & 0xf) << 8);
> --
> 2.22.0
>
--
Kees Cook
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through
2019-07-29 20:54 [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-29 21:48 ` Kees Cook
@ 2019-07-30 7:05 ` Geert Uytterhoeven
2019-07-30 7:36 ` Takashi Iwai
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2019-07-30 7:05 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Jaroslav Kysela, Takashi Iwai, ALSA Development Mailing List,
Linux Kernel Mailing List, Kees Cook
On Mon, Jul 29, 2019 at 10:55 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 (Building: m68k):
>
> 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>
> ---
> Changes in v2:
> - Update code so switch and case statements are at the same indent.
Thanks, this time it works as expected.
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
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] 4+ messages in thread
* Re: [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through
2019-07-29 20:54 [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-29 21:48 ` Kees Cook
2019-07-30 7:05 ` Geert Uytterhoeven
@ 2019-07-30 7:36 ` Takashi Iwai
2 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2019-07-30 7:36 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Jaroslav Kysela, alsa-devel, Kees Cook, Geert Uytterhoeven, linux-kernel
On Mon, 29 Jul 2019 22:54:54 +0200,
Gustavo A. R. Silva wrote:
>
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warning (Building: m68k):
>
> 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>
> ---
> Changes in v2:
> - Update code so switch and case statements are at the same indent.
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-30 7:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 20:54 [PATCH v2] sound: dmasound_atari: Mark expected switch fall-through Gustavo A. R. Silva
2019-07-29 21:48 ` Kees Cook
2019-07-30 7:05 ` Geert Uytterhoeven
2019-07-30 7:36 ` Takashi Iwai
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).