Skip to contentSkip to conversation

sound: dmasound_atari: Mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 4 participants 4 messages Jul 29, 2019 – Jul 30, 2019 Sound

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 (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.

---
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(-)
sound/oss/dmasound/dmasound_atari.c +8 -8
index 83653683fd68..823ccfa089b2 100644
@@ -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);
Signature · 1 line
2.22.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: m68k):

Quoted 8 lines

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.

-Kees

Quoted 48 lines

---
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(-)
sound/oss/dmasound/dmasound_atari.c +8 -8
index 83653683fd68..823ccfa089b2 100644
@@ -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);
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
Tested-by on v2 1/1
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 7 lines · Gustavo A. R. Silva

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

Quoted 8 lines

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

---
Changes in v2:
- Update code so switch and case statements are at the same indent.

Thanks, this time it works as expected.

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
Applied
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

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

Quoted 8 lines

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

---
Changes in v2:
- Update code so switch and case statements are at the same indent.

Applied, thanks.

Takashi