linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: intel8x0: Fix fall-through annotations
@ 2018-10-03 10:38 Gustavo A. R. Silva
  2018-10-03 16:08 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-03 10:38 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel, Gustavo A. R. Silva

Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 sound/pci/intel8x0.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 9517f9b..ffddcdf 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -825,7 +825,7 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_RESUME:
 		ichdev->suspended = 0;
-		/* fallthru */
+		/* fall through */
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		val = ICH_IOCE | ICH_STARTBM;
@@ -833,7 +833,7 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
 		break;
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 		ichdev->suspended = 1;
-		/* fallthru */
+		/* fall through */
 	case SNDRV_PCM_TRIGGER_STOP:
 		val = 0;
 		break;
@@ -867,7 +867,7 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_RESUME:
 		ichdev->suspended = 0;
-		/* fallthru */
+		/* fall through */
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -884,7 +884,7 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd
 		break;
 	case SNDRV_PCM_TRIGGER_SUSPEND:
 		ichdev->suspended = 1;
-		/* fallthru */
+		/* fall through */
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 		/* pause */
-- 
2.7.4


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

* Re: [PATCH] ALSA: intel8x0: Fix fall-through annotations
  2018-10-03 10:38 [PATCH] ALSA: intel8x0: Fix fall-through annotations Gustavo A. R. Silva
@ 2018-10-03 16:08 ` Takashi Iwai
  2018-10-03 16:19   ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2018-10-03 16:08 UTC (permalink / raw)
  To:  Gustavo A. R. Silva ; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

On Wed, 03 Oct 2018 12:38:36 +0200,
 Gustavo A. R. Silva  wrote:
> 
> Replace "fallthru" with a proper "fall through" annotation.
> 
> This fix is part of the ongoing efforts to enabling
> -Wimplicit-fallthrough
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks, applied.


Takashi

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

* Re: [PATCH] ALSA: intel8x0: Fix fall-through annotations
  2018-10-03 16:08 ` Takashi Iwai
@ 2018-10-03 16:19   ` Takashi Iwai
  2018-10-03 18:08     ` Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2018-10-03 16:19 UTC (permalink / raw)
  To:  Gustavo A. R. Silva ; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

On Wed, 03 Oct 2018 18:08:07 +0200,
Takashi Iwai wrote:
> 
> On Wed, 03 Oct 2018 12:38:36 +0200,
>  Gustavo A. R. Silva  wrote:
> > 
> > Replace "fallthru" with a proper "fall through" annotation.
> > 
> > This fix is part of the ongoing efforts to enabling
> > -Wimplicit-fallthrough
> > 
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Thanks, applied.

BTW, does "fallthru" really cause a warning?  I thought it's also
accepted as well as "fall-through".  At least, my gcc-8 doesn't give a
warning with "fallthru".


Takashi

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

* Re: [PATCH] ALSA: intel8x0: Fix fall-through annotations
  2018-10-03 16:19   ` Takashi Iwai
@ 2018-10-03 18:08     ` Gustavo A. R. Silva
  2018-10-03 18:34       ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-03 18:08 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel



On 10/3/18 6:19 PM, Takashi Iwai wrote:
> On Wed, 03 Oct 2018 18:08:07 +0200,
> Takashi Iwai wrote:
>>
>> On Wed, 03 Oct 2018 12:38:36 +0200,
>>  Gustavo A. R. Silva  wrote:
>>>
>>> Replace "fallthru" with a proper "fall through" annotation.
>>>
>>> This fix is part of the ongoing efforts to enabling
>>> -Wimplicit-fallthrough
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>
>> Thanks, applied.
> 
> BTW, does "fallthru" really cause a warning?  I thought it's also
> accepted as well as "fall-through".  At least, my gcc-8 doesn't give a
> warning with "fallthru".
> 

You are correct. It does not trigger a warning.

There are about 50 similar instances in the whole codebase. And, as they
are just a few, what I'm trying to do is to replace them with the most
commonly used form: "fall through"

Thanks
--
Gustavo

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

* Re: [PATCH] ALSA: intel8x0: Fix fall-through annotations
  2018-10-03 18:08     ` Gustavo A. R. Silva
@ 2018-10-03 18:34       ` Takashi Iwai
  2018-10-03 18:40         ` Gustavo A. R. Silva
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2018-10-03 18:34 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

On Wed, 03 Oct 2018 20:08:31 +0200,
Gustavo A. R. Silva wrote:
> 
> 
> 
> On 10/3/18 6:19 PM, Takashi Iwai wrote:
> > On Wed, 03 Oct 2018 18:08:07 +0200,
> > Takashi Iwai wrote:
> >>
> >> On Wed, 03 Oct 2018 12:38:36 +0200,
> >>  Gustavo A. R. Silva  wrote:
> >>>
> >>> Replace "fallthru" with a proper "fall through" annotation.
> >>>
> >>> This fix is part of the ongoing efforts to enabling
> >>> -Wimplicit-fallthrough
> >>>
> >>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >>
> >> Thanks, applied.
> > 
> > BTW, does "fallthru" really cause a warning?  I thought it's also
> > accepted as well as "fall-through".  At least, my gcc-8 doesn't give a
> > warning with "fallthru".
> > 
> 
> You are correct. It does not trigger a warning.
> 
> There are about 50 similar instances in the whole codebase. And, as they
> are just a few, what I'm trying to do is to replace them with the most
> commonly used form: "fall through"

Hm, then I'm not sure whether it's worth for further similar
replacements.  A term "fallthru" is also very commonly used, and the
compiler knows it, too, so why bother to rewrite?

I don't mean to revert the already applied changes, but maybe better
to concentrate on fixing other real bugs (and/or real warnings).


thanks,

Takashi

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

* Re: [PATCH] ALSA: intel8x0: Fix fall-through annotations
  2018-10-03 18:34       ` Takashi Iwai
@ 2018-10-03 18:40         ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-03 18:40 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel



On 10/3/18 8:34 PM, Takashi Iwai wrote:
>>
>> You are correct. It does not trigger a warning.
>>
>> There are about 50 similar instances in the whole codebase. And, as they
>> are just a few, what I'm trying to do is to replace them with the most
>> commonly used form: "fall through"
> 
> Hm, then I'm not sure whether it's worth for further similar
> replacements.  A term "fallthru" is also very commonly used, and the
> compiler knows it, too, so why bother to rewrite?
> 

Not that common actually. There are more than 2000 instances of "fall through"
and just ~50 of "fallthru" and ~40 of "fall thru"

> I don't mean to revert the already applied changes, but maybe better
> to concentrate on fixing other real bugs (and/or real warnings).
> 

Yeah. Sure thing. It's just that I sort of ran into those cases a few days ago.

Thanks
--
Gustavo

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

end of thread, other threads:[~2018-10-03 18:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 10:38 [PATCH] ALSA: intel8x0: Fix fall-through annotations Gustavo A. R. Silva
2018-10-03 16:08 ` Takashi Iwai
2018-10-03 16:19   ` Takashi Iwai
2018-10-03 18:08     ` Gustavo A. R. Silva
2018-10-03 18:34       ` Takashi Iwai
2018-10-03 18:40         ` Gustavo A. R. Silva

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