Skip to content

Commit c0dbbda

Browse files
GustavoARSilvatiwai
authored andcommitted
ALSA: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200708203236.GA5112@embeddedor Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent a0b224b commit c0dbbda

35 files changed

Lines changed: 78 additions & 80 deletions

‎sound/atmel/ac97c.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,14 @@ atmel_ac97c_playback_trigger(struct snd_pcm_substream *substream, int cmd)
356356
camr = ac97c_readl(chip, CAMR);
357357

358358
switch (cmd) {
359-
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */
360-
case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
359+
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
360+
case SNDRV_PCM_TRIGGER_RESUME:
361361
case SNDRV_PCM_TRIGGER_START:
362362
ptcr = ATMEL_PDC_TXTEN;
363363
camr |= AC97C_CMR_CENA | AC97C_CSR_ENDTX;
364364
break;
365-
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */
366-
case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */
365+
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
366+
case SNDRV_PCM_TRIGGER_SUSPEND:
367367
case SNDRV_PCM_TRIGGER_STOP:
368368
ptcr |= ATMEL_PDC_TXTDIS;
369369
if (chip->opened <= 1)
@@ -388,14 +388,14 @@ atmel_ac97c_capture_trigger(struct snd_pcm_substream *substream, int cmd)
388388
ptcr = readl(chip->regs + ATMEL_PDC_PTSR);
389389

390390
switch (cmd) {
391-
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */
392-
case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
391+
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
392+
case SNDRV_PCM_TRIGGER_RESUME:
393393
case SNDRV_PCM_TRIGGER_START:
394394
ptcr = ATMEL_PDC_RXTEN;
395395
camr |= AC97C_CMR_CENA | AC97C_CSR_ENDRX;
396396
break;
397-
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */
398-
case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */
397+
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
398+
case SNDRV_PCM_TRIGGER_SUSPEND:
399399
case SNDRV_PCM_TRIGGER_STOP:
400400
ptcr |= ATMEL_PDC_RXTDIS;
401401
if (chip->opened <= 1)

‎sound/core/memalloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
158158
*/
159159
dmab->dev.type = SNDRV_DMA_TYPE_DEV;
160160
#endif /* CONFIG_GENERIC_ALLOCATOR */
161-
/* fall through */
161+
fallthrough;
162162
case SNDRV_DMA_TYPE_DEV:
163163
case SNDRV_DMA_TYPE_DEV_UC:
164164
snd_malloc_dev_pages(dmab, size);

‎sound/core/oss/pcm_oss.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
28512851
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
28522852
if (substream)
28532853
break;
2854-
/* Fall through */
2854+
fallthrough;
28552855
case VM_READ:
28562856
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE];
28572857
break;

‎sound/core/oss/pcm_plugin.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ snd_pcm_format_t snd_pcm_plug_slave_format(snd_pcm_format_t format,
357357
if (snd_mask_test(format_mask, (__force int)format1))
358358
return format1;
359359
}
360-
/* fall through */
360+
fallthrough;
361361
default:
362362
return (__force snd_pcm_format_t)-EINVAL;
363363
}

‎sound/core/pcm_native.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ static int snd_pcm_prepare(struct snd_pcm_substream *substream,
19031903
switch (substream->runtime->status->state) {
19041904
case SNDRV_PCM_STATE_PAUSED:
19051905
snd_pcm_pause(substream, false);
1906-
/* fallthru */
1906+
fallthrough;
19071907
case SNDRV_PCM_STATE_SUSPENDED:
19081908
snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
19091909
break;
@@ -2811,7 +2811,7 @@ static int do_pcm_hwsync(struct snd_pcm_substream *substream)
28112811
case SNDRV_PCM_STATE_DRAINING:
28122812
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
28132813
return -EBADFD;
2814-
/* Fall through */
2814+
fallthrough;
28152815
case SNDRV_PCM_STATE_RUNNING:
28162816
return snd_pcm_update_hw_ptr(substream);
28172817
case SNDRV_PCM_STATE_PREPARED:
@@ -3814,15 +3814,15 @@ static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
38143814
case SNDRV_PCM_MMAP_OFFSET_STATUS_OLD:
38153815
if (pcm_file->no_compat_mmap || !IS_ENABLED(CONFIG_64BIT))
38163816
return -ENXIO;
3817-
/* fallthrough */
3817+
fallthrough;
38183818
case SNDRV_PCM_MMAP_OFFSET_STATUS_NEW:
38193819
if (!pcm_status_mmap_allowed(pcm_file))
38203820
return -ENXIO;
38213821
return snd_pcm_mmap_status(substream, file, area);
38223822
case SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD:
38233823
if (pcm_file->no_compat_mmap || !IS_ENABLED(CONFIG_64BIT))
38243824
return -ENXIO;
3825-
/* fallthrough */
3825+
fallthrough;
38263826
case SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW:
38273827
if (!pcm_control_mmap_allowed(pcm_file))
38283828
return -ENXIO;

‎sound/core/seq/oss/seq_oss_timer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ snd_seq_oss_process_timer_event(struct seq_oss_timer *rec, union evrec *ev)
7979
case TMR_WAIT_REL:
8080
parm += rec->cur_tick;
8181
rec->realtime = 0;
82-
/* fall through */
82+
fallthrough;
8383
case TMR_WAIT_ABS:
8484
if (parm == 0) {
8585
rec->realtime = 1;

‎sound/core/seq/seq_midi_emul.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ do_control(const struct snd_midi_op *ops, void *drv,
309309
break;
310310
case MIDI_CTL_MSB_DATA_ENTRY:
311311
chan->control[MIDI_CTL_LSB_DATA_ENTRY] = 0;
312-
/* fall through */
312+
fallthrough;
313313
case MIDI_CTL_LSB_DATA_ENTRY:
314314
if (chan->param_type == SNDRV_MIDI_PARAM_TYPE_REGISTERED)
315315
rpn(ops, drv, chan, chset);

‎sound/drivers/opl3/opl3_midi.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
354354
instr_4op = 1;
355355
break;
356356
}
357-
/* fall through */
357+
fallthrough;
358358
default:
359359
spin_unlock_irqrestore(&opl3->voice_lock, flags);
360360
return;
@@ -443,7 +443,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
443443
switch (connection) {
444444
case 0x03:
445445
snd_opl3_calc_volume(&vol_op[2], vel, chan);
446-
/* fallthru */
446+
fallthrough;
447447
case 0x02:
448448
snd_opl3_calc_volume(&vol_op[0], vel, chan);
449449
break;

‎sound/isa/galaxy/galaxy.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static int snd_galaxy_match(struct device *dev, unsigned int n)
247247
break;
248248
case 2:
249249
irq[n] = 9;
250-
/* Fall through */
250+
fallthrough;
251251
case 9:
252252
wss_config[n] |= WSS_CONFIG_IRQ_9;
253253
break;
@@ -292,7 +292,7 @@ static int snd_galaxy_match(struct device *dev, unsigned int n)
292292
case 1:
293293
if (dma1[n] == 0)
294294
break;
295-
/* Fall through */
295+
fallthrough;
296296
default:
297297
dev_err(dev, "invalid capture DMA %d\n", dma2[n]);
298298
return 0;
@@ -322,7 +322,7 @@ static int snd_galaxy_match(struct device *dev, unsigned int n)
322322
break;
323323
case 2:
324324
mpu_irq[n] = 9;
325-
/* Fall through */
325+
fallthrough;
326326
case 9:
327327
config[n] |= GALAXY_CONFIG_MPUIRQ_2;
328328
break;

‎sound/isa/msnd/msnd_pinnacle_mixer.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,9 @@ static int snd_msndmix_set(struct snd_msnd *dev, int d, int left, int right)
219219
case MSND_MIXER_VOLUME: /* master volume */
220220
writew(wLeft, dev->SMA + SMA_wCurrMastVolLeft);
221221
writew(wRight, dev->SMA + SMA_wCurrMastVolRight);
222-
/* fall through */
223-
222+
fallthrough;
224223
case MSND_MIXER_AUX: /* aux pot control */
225224
/* scaled by master volume */
226-
/* fall through */
227225

228226
/* digital controls */
229227
case MSND_MIXER_SYNTH: /* synth vol (dsp mix) */

0 commit comments

Comments
 (0)