* [PATCH 0/4] ALSA: Mark expected switch fall-throughs
@ 2018-08-02 20:40 Gustavo A. R. Silva
2018-08-02 20:40 ` [PATCH 1/4] ALSA: galaxy: " Gustavo A. R. Silva
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: alsa-devel, Takashi Iwai, Jaroslav Kysela, Gustavo A. R. Silva
Hi all,
In preparation to enabling -Wimplicit-fallthrough, this patchset aims
to add some annotations in order to mark switch cases where we are
expecting to fall through.
Thanks
Gustavo A. R. Silva (4):
ALSA: galaxy: Mark expected switch fall-through
ALSA: opti92x: mark expected switch fall-through
ALSA: opti9xx: mark expected switch fall-through
ALSA: es18xx: mark expected switch fall-through
sound/isa/es18xx.c | 1 +
sound/isa/galaxy/galaxy.c | 3 +++
sound/isa/opti9xx/miro.c | 5 +++++
sound/isa/opti9xx/opti92x-ad1848.c | 3 +++
4 files changed, 12 insertions(+)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] ALSA: galaxy: Mark expected switch fall-throughs
2018-08-02 20:40 [PATCH 0/4] ALSA: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-08-02 20:40 ` Gustavo A. R. Silva
2018-08-02 20:41 ` [PATCH 2/4] ALSA: opti92x: mark " Gustavo A. R. Silva
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 20:40 UTC (permalink / raw)
To: linux-kernel
Cc: alsa-devel, Takashi Iwai, Jaroslav Kysela, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Addresses-Coverity-ID: 1468367 ("Missing break in switch")
Addresses-Coverity-ID: 115037 ("Missing break in switch")
Addresses-Coverity-ID: 115038 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
sound/isa/galaxy/galaxy.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/isa/galaxy/galaxy.c b/sound/isa/galaxy/galaxy.c
index b9994cc..af9eea4 100644
--- a/sound/isa/galaxy/galaxy.c
+++ b/sound/isa/galaxy/galaxy.c
@@ -260,6 +260,7 @@ static int snd_galaxy_match(struct device *dev, unsigned int n)
break;
case 2:
irq[n] = 9;
+ /* Fall through */
case 9:
wss_config[n] |= WSS_CONFIG_IRQ_9;
break;
@@ -304,6 +305,7 @@ static int snd_galaxy_match(struct device *dev, unsigned int n)
case 1:
if (dma1[n] == 0)
break;
+ /* Fall through */
default:
dev_err(dev, "invalid capture DMA %d\n", dma2[n]);
return 0;
@@ -333,6 +335,7 @@ static int snd_galaxy_match(struct device *dev, unsigned int n)
break;
case 2:
mpu_irq[n] = 9;
+ /* Fall through */
case 9:
config[n] |= GALAXY_CONFIG_MPUIRQ_2;
break;
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] ALSA: opti92x: mark expected switch fall-throughs
2018-08-02 20:40 [PATCH 0/4] ALSA: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-08-02 20:40 ` [PATCH 1/4] ALSA: galaxy: " Gustavo A. R. Silva
@ 2018-08-02 20:41 ` Gustavo A. R. Silva
2018-08-02 20:41 ` [PATCH 3/4] ALSA: opti9xx: " Gustavo A. R. Silva
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 20:41 UTC (permalink / raw)
To: linux-kernel
Cc: alsa-devel, Takashi Iwai, Jaroslav Kysela, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Addresses-Coverity-ID: 1165394 ("Missing break in switch")
Addresses-Coverity-ID: 1167851 ("Missing break in switch")
Addresses-Coverity-ID: 402015 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
sound/isa/opti9xx/opti92x-ad1848.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 505cd81..ac0ab6e 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -261,6 +261,7 @@ static unsigned char snd_opti9xx_read(struct snd_opti9xx *chip,
retval = inb(chip->mc_base + 9);
break;
}
+ /* Fall through */
case OPTi9XX_HW_82C928:
case OPTi9XX_HW_82C929:
@@ -303,6 +304,7 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg,
outb(value, chip->mc_base + 9);
break;
}
+ /* Fall through */
case OPTi9XX_HW_82C928:
case OPTi9XX_HW_82C929:
@@ -350,6 +352,7 @@ static int snd_opti9xx_configure(struct snd_opti9xx *chip,
snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(4), 0xf0, 0xfc);
/* enable wave audio */
snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(6), 0x02, 0x02);
+ /* Fall through */
case OPTi9XX_HW_82C925:
/* enable WSS mode */
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ALSA: opti9xx: mark expected switch fall-throughs
2018-08-02 20:40 [PATCH 0/4] ALSA: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-08-02 20:40 ` [PATCH 1/4] ALSA: galaxy: " Gustavo A. R. Silva
2018-08-02 20:41 ` [PATCH 2/4] ALSA: opti92x: mark " Gustavo A. R. Silva
@ 2018-08-02 20:41 ` Gustavo A. R. Silva
2018-08-02 20:42 ` [PATCH 4/4] ALSA: es18xx: mark expected switch fall-through Gustavo A. R. Silva
2018-08-03 10:21 ` [alsa-devel] [PATCH 0/4] ALSA: Mark expected switch fall-throughs Takashi Iwai
4 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 20:41 UTC (permalink / raw)
To: linux-kernel
Cc: alsa-devel, Takashi Iwai, Jaroslav Kysela, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Addresses-Coverity-ID: 402016 ("Missing break in switch")
Addresses-Coverity-ID: 1056542 ("Missing break in switch")
Addresses-Coverity-ID: 1339579 ("Missing break in switch")
Addresses-Coverity-ID: 1369526 ("Missing break in switch")
Addresses-Coverity-ID: 1369529 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
sound/isa/opti9xx/miro.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 8894c7c..c6136c6 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -176,10 +176,13 @@ static int aci_busy_wait(struct snd_miro_aci *aci)
switch (timeout-ACI_MINTIME) {
case 0 ... 9:
out /= 10;
+ /* fall through */
case 10 ... 19:
out /= 10;
+ /* fall through */
case 20 ... 30:
out /= 10;
+ /* fall through */
default:
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(out);
@@ -834,6 +837,7 @@ static unsigned char snd_miro_read(struct snd_miro *chip,
retval = inb(chip->mc_base + 9);
break;
}
+ /* fall through */
case OPTi9XX_HW_82C929:
retval = inb(chip->mc_base + reg);
@@ -863,6 +867,7 @@ static void snd_miro_write(struct snd_miro *chip, unsigned char reg,
outb(value, chip->mc_base + 9);
break;
}
+ /* fall through */
case OPTi9XX_HW_82C929:
outb(value, chip->mc_base + reg);
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ALSA: es18xx: mark expected switch fall-through
2018-08-02 20:40 [PATCH 0/4] ALSA: Mark expected switch fall-throughs Gustavo A. R. Silva
` (2 preceding siblings ...)
2018-08-02 20:41 ` [PATCH 3/4] ALSA: opti9xx: " Gustavo A. R. Silva
@ 2018-08-02 20:42 ` Gustavo A. R. Silva
2018-08-03 10:21 ` [alsa-devel] [PATCH 0/4] ALSA: Mark expected switch fall-throughs Takashi Iwai
4 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-02 20:42 UTC (permalink / raw)
To: linux-kernel
Cc: alsa-devel, Takashi Iwai, Jaroslav Kysela, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Addresses-Coverity-ID: 115075 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
sound/isa/es18xx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 2a6960c..0d103d6 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -1024,6 +1024,7 @@ static int snd_es18xx_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
val = 3;
} else
retVal = snd_es18xx_mixer_bits(chip, 0x7a, 0x08, 0x00) != 0x00;
+ /* fall through */
/* 4 source chips */
case 0x1868:
case 0x1878:
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [alsa-devel] [PATCH 0/4] ALSA: Mark expected switch fall-throughs
2018-08-02 20:40 [PATCH 0/4] ALSA: Mark expected switch fall-throughs Gustavo A. R. Silva
` (3 preceding siblings ...)
2018-08-02 20:42 ` [PATCH 4/4] ALSA: es18xx: mark expected switch fall-through Gustavo A. R. Silva
@ 2018-08-03 10:21 ` Takashi Iwai
4 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2018-08-03 10:21 UTC (permalink / raw)
To: Gustavo A. R. Silva; +Cc: linux-kernel, alsa-devel
On Thu, 02 Aug 2018 22:40:08 +0200,
Gustavo A. R. Silva wrote:
>
> Hi all,
>
> In preparation to enabling -Wimplicit-fallthrough, this patchset aims
> to add some annotations in order to mark switch cases where we are
> expecting to fall through.
>
> Thanks
>
> Gustavo A. R. Silva (4):
> ALSA: galaxy: Mark expected switch fall-through
> ALSA: opti92x: mark expected switch fall-through
> ALSA: opti9xx: mark expected switch fall-through
> ALSA: es18xx: mark expected switch fall-through
Applied all four patches now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-03 10:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-02 20:40 [PATCH 0/4] ALSA: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-08-02 20:40 ` [PATCH 1/4] ALSA: galaxy: " Gustavo A. R. Silva
2018-08-02 20:41 ` [PATCH 2/4] ALSA: opti92x: mark " Gustavo A. R. Silva
2018-08-02 20:41 ` [PATCH 3/4] ALSA: opti9xx: " Gustavo A. R. Silva
2018-08-02 20:42 ` [PATCH 4/4] ALSA: es18xx: mark expected switch fall-through Gustavo A. R. Silva
2018-08-03 10:21 ` [alsa-devel] [PATCH 0/4] ALSA: Mark expected switch fall-throughs 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).