Skip to contentSkip to conversation

sound: dmasound_atari: Mark expected switch fall-through

PATCH Superseded Gustavo A. R. Silva 2 participants 2 messages Jul 29, 2019 Sound

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound: dmasound_atari: Mark expected switch fall-through

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.

---
 sound/oss/dmasound/dmasound_atari.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/oss/dmasound/dmasound_atari.c +1 -1
index 83653683fd68..b5845e904ba1 100644
@@ -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) |
Signature · 1 line
2.22.0
#1 lore raw

Hi Gustavo,

Thanks for your patch!

Quoted 9 lines · Gustavo A. R. Silva

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

Quoted 11 lines
---
 sound/oss/dmasound/dmasound_atari.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/oss/dmasound/dmasound_atari.c +0 -0
index 83653683fd68..b5845e904ba1 100644

sound/oss/dmasound/dmasound_atari.c static int FalconMixerIoctl(u_int cmd, u_long arg) · line 1455

Quoted 8 lines
sound/oss/dmasound/dmasound_atari.c +1 -1
@@ -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

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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