Skip to content

Commit 5d51fdd

Browse files
Dr. David Alan Gilberttiwai
authored andcommitted
ALSA: gus: Remove deadcode
snd_gus_use_dec(), snd_gus_use_inc() and snd_gf1_print_voice_registers() last uses were removed in 2007 by commit e5723b4 ("[ALSA] Remove sequencer instrument layer") Remove them. While there, remove big #if 0 blocks next to the code being deleted. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://patch.msgid.link/20250508000225.195766-1-linux@treblig.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 28a09d9 commit 5d51fdd

3 files changed

Lines changed: 0 additions & 249 deletions

File tree

include/sound/gus.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,8 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus);
578578

579579
int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index);
580580

581-
#ifdef CONFIG_SND_DEBUG
582-
extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus);
583-
#endif
584-
585581
/* gus.c */
586582

587-
int snd_gus_use_inc(struct snd_gus_card * gus);
588-
void snd_gus_use_dec(struct snd_gus_card * gus);
589583
int snd_gus_create(struct snd_card *card,
590584
unsigned long port,
591585
int irq, int dma1, int dma2,

sound/isa/gus/gus_io.c

Lines changed: 0 additions & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -228,49 +228,6 @@ unsigned short snd_gf1_i_look16(struct snd_gus_card * gus, unsigned char reg)
228228
return res;
229229
}
230230

231-
#if 0
232-
233-
void snd_gf1_i_adlib_write(struct snd_gus_card * gus,
234-
unsigned char reg,
235-
unsigned char data)
236-
{
237-
unsigned long flags;
238-
239-
spin_lock_irqsave(&gus->reg_lock, flags);
240-
__snd_gf1_adlib_write(gus, reg, data);
241-
spin_unlock_irqrestore(&gus->reg_lock, flags);
242-
}
243-
244-
void snd_gf1_i_write_addr(struct snd_gus_card * gus, unsigned char reg,
245-
unsigned int addr, short w_16bit)
246-
{
247-
unsigned long flags;
248-
249-
spin_lock_irqsave(&gus->reg_lock, flags);
250-
__snd_gf1_write_addr(gus, reg, addr, w_16bit);
251-
spin_unlock_irqrestore(&gus->reg_lock, flags);
252-
}
253-
254-
#endif /* 0 */
255-
256-
#ifdef CONFIG_SND_DEBUG
257-
static unsigned int snd_gf1_i_read_addr(struct snd_gus_card * gus,
258-
unsigned char reg, short w_16bit)
259-
{
260-
unsigned int res;
261-
unsigned long flags;
262-
263-
spin_lock_irqsave(&gus->reg_lock, flags);
264-
res = __snd_gf1_read_addr(gus, reg, w_16bit);
265-
spin_unlock_irqrestore(&gus->reg_lock, flags);
266-
return res;
267-
}
268-
#endif
269-
270-
/*
271-
272-
*/
273-
274231
void snd_gf1_dram_addr(struct snd_gus_card * gus, unsigned int addr)
275232
{
276233
outb(0x43, gus->gf1.reg_regsel);
@@ -418,189 +375,3 @@ void snd_gf1_select_active_voices(struct snd_gus_card * gus)
418375
udelay(100);
419376
}
420377
}
421-
422-
#ifdef CONFIG_SND_DEBUG
423-
424-
void snd_gf1_print_voice_registers(struct snd_gus_card * gus)
425-
{
426-
unsigned char mode;
427-
int voice, ctrl;
428-
429-
voice = gus->gf1.active_voice;
430-
dev_info(gus->card->dev,
431-
" -%i- GF1 voice ctrl, ramp ctrl = 0x%x, 0x%x\n",
432-
voice, ctrl = snd_gf1_i_read8(gus, 0), snd_gf1_i_read8(gus, 0x0d));
433-
dev_info(gus->card->dev,
434-
" -%i- GF1 frequency = 0x%x\n",
435-
voice, snd_gf1_i_read16(gus, 1));
436-
dev_info(gus->card->dev,
437-
" -%i- GF1 loop start, end = 0x%x (0x%x), 0x%x (0x%x)\n",
438-
voice, snd_gf1_i_read_addr(gus, 2, ctrl & 4),
439-
snd_gf1_i_read_addr(gus, 2, (ctrl & 4) ^ 4),
440-
snd_gf1_i_read_addr(gus, 4, ctrl & 4),
441-
snd_gf1_i_read_addr(gus, 4, (ctrl & 4) ^ 4));
442-
dev_info(gus->card->dev,
443-
" -%i- GF1 ramp start, end, rate = 0x%x, 0x%x, 0x%x\n",
444-
voice, snd_gf1_i_read8(gus, 7), snd_gf1_i_read8(gus, 8),
445-
snd_gf1_i_read8(gus, 6));
446-
dev_info(gus->card->dev,
447-
" -%i- GF1 volume = 0x%x\n",
448-
voice, snd_gf1_i_read16(gus, 9));
449-
dev_info(gus->card->dev,
450-
" -%i- GF1 position = 0x%x (0x%x)\n",
451-
voice, snd_gf1_i_read_addr(gus, 0x0a, ctrl & 4),
452-
snd_gf1_i_read_addr(gus, 0x0a, (ctrl & 4) ^ 4));
453-
if (gus->interwave && snd_gf1_i_read8(gus, 0x19) & 0x01) { /* enhanced mode */
454-
mode = snd_gf1_i_read8(gus, 0x15);
455-
dev_info(gus->card->dev,
456-
" -%i- GFA1 mode = 0x%x\n",
457-
voice, mode);
458-
if (mode & 0x01) { /* Effect processor */
459-
dev_info(gus->card->dev,
460-
" -%i- GFA1 effect address = 0x%x\n",
461-
voice, snd_gf1_i_read_addr(gus, 0x11, ctrl & 4));
462-
dev_info(gus->card->dev,
463-
" -%i- GFA1 effect volume = 0x%x\n",
464-
voice, snd_gf1_i_read16(gus, 0x16));
465-
dev_info(gus->card->dev,
466-
" -%i- GFA1 effect volume final = 0x%x\n",
467-
voice, snd_gf1_i_read16(gus, 0x1d));
468-
dev_info(gus->card->dev,
469-
" -%i- GFA1 effect accumulator = 0x%x\n",
470-
voice, snd_gf1_i_read8(gus, 0x14));
471-
}
472-
if (mode & 0x20) {
473-
dev_info(gus->card->dev,
474-
" -%i- GFA1 left offset = 0x%x (%i)\n",
475-
voice, snd_gf1_i_read16(gus, 0x13),
476-
snd_gf1_i_read16(gus, 0x13) >> 4);
477-
dev_info(gus->card->dev,
478-
" -%i- GFA1 left offset final = 0x%x (%i)\n",
479-
voice, snd_gf1_i_read16(gus, 0x1c),
480-
snd_gf1_i_read16(gus, 0x1c) >> 4);
481-
dev_info(gus->card->dev,
482-
" -%i- GFA1 right offset = 0x%x (%i)\n",
483-
voice, snd_gf1_i_read16(gus, 0x0c),
484-
snd_gf1_i_read16(gus, 0x0c) >> 4);
485-
dev_info(gus->card->dev,
486-
" -%i- GFA1 right offset final = 0x%x (%i)\n",
487-
voice, snd_gf1_i_read16(gus, 0x1b),
488-
snd_gf1_i_read16(gus, 0x1b) >> 4);
489-
} else
490-
dev_info(gus->card->dev,
491-
" -%i- GF1 pan = 0x%x\n",
492-
voice, snd_gf1_i_read8(gus, 0x0c));
493-
} else
494-
dev_info(gus->card->dev,
495-
" -%i- GF1 pan = 0x%x\n",
496-
voice, snd_gf1_i_read8(gus, 0x0c));
497-
}
498-
499-
#if 0
500-
501-
void snd_gf1_print_global_registers(struct snd_gus_card * gus)
502-
{
503-
unsigned char global_mode = 0x00;
504-
505-
dev_info(gus->card->dev,
506-
" -G- GF1 active voices = 0x%x\n",
507-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_ACTIVE_VOICES));
508-
if (gus->interwave) {
509-
global_mode = snd_gf1_i_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE);
510-
dev_info(gus->card->dev,
511-
" -G- GF1 global mode = 0x%x\n",
512-
global_mode);
513-
}
514-
if (global_mode & 0x02) /* LFO enabled? */
515-
dev_info(gus->card->dev,
516-
" -G- GF1 LFO base = 0x%x\n",
517-
snd_gf1_i_look16(gus, SNDRV_GF1_GW_LFO_BASE));
518-
dev_info(gus->card->dev,
519-
" -G- GF1 voices IRQ read = 0x%x\n",
520-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_VOICES_IRQ_READ));
521-
dev_info(gus->card->dev,
522-
" -G- GF1 DRAM DMA control = 0x%x\n",
523-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL));
524-
dev_info(gus->card->dev,
525-
" -G- GF1 DRAM DMA high/low = 0x%x/0x%x\n",
526-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_HIGH),
527-
snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_DMA_LOW));
528-
dev_info(gus->card->dev,
529-
" -G- GF1 DRAM IO high/low = 0x%x/0x%x\n",
530-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_IO_HIGH),
531-
snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_IO_LOW));
532-
if (!gus->interwave)
533-
dev_info(gus->card->dev,
534-
" -G- GF1 record DMA control = 0x%x\n",
535-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL));
536-
dev_info(gus->card->dev,
537-
" -G- GF1 DRAM IO 16 = 0x%x\n",
538-
snd_gf1_i_look16(gus, SNDRV_GF1_GW_DRAM_IO16));
539-
if (gus->gf1.enh_mode) {
540-
dev_info(gus->card->dev,
541-
" -G- GFA1 memory config = 0x%x\n",
542-
snd_gf1_i_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG));
543-
dev_info(gus->card->dev,
544-
" -G- GFA1 memory control = 0x%x\n",
545-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_MEMORY_CONTROL));
546-
dev_info(gus->card->dev,
547-
" -G- GFA1 FIFO record base = 0x%x\n",
548-
snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR));
549-
dev_info(gus->card->dev,
550-
" -G- GFA1 FIFO playback base = 0x%x\n",
551-
snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR));
552-
dev_info(gus->card->dev,
553-
" -G- GFA1 interleave control = 0x%x\n",
554-
snd_gf1_i_look16(gus, SNDRV_GF1_GW_INTERLEAVE));
555-
}
556-
}
557-
558-
void snd_gf1_print_setup_registers(struct snd_gus_card * gus)
559-
{
560-
dev_info(gus->card->dev,
561-
" -S- mix control = 0x%x\n",
562-
inb(GUSP(gus, MIXCNTRLREG)));
563-
dev_info(gus->card->dev,
564-
" -S- IRQ status = 0x%x\n",
565-
inb(GUSP(gus, IRQSTAT)));
566-
dev_info(gus->card->dev,
567-
" -S- timer control = 0x%x\n",
568-
inb(GUSP(gus, TIMERCNTRL)));
569-
dev_info(gus->card->dev,
570-
" -S- timer data = 0x%x\n",
571-
inb(GUSP(gus, TIMERDATA)));
572-
dev_info(gus->card->dev,
573-
" -S- status read = 0x%x\n",
574-
inb(GUSP(gus, REGCNTRLS)));
575-
dev_info(gus->card->dev,
576-
" -S- Sound Blaster control = 0x%x\n",
577-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL));
578-
dev_info(gus->card->dev,
579-
" -S- AdLib timer 1/2 = 0x%x/0x%x\n",
580-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1),
581-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_2));
582-
dev_info(gus->card->dev,
583-
" -S- reset = 0x%x\n",
584-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET));
585-
if (gus->interwave) {
586-
dev_info(gus->card->dev,
587-
" -S- compatibility = 0x%x\n",
588-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_COMPATIBILITY));
589-
dev_info(gus->card->dev,
590-
" -S- decode control = 0x%x\n",
591-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_DECODE_CONTROL));
592-
dev_info(gus->card->dev,
593-
" -S- version number = 0x%x\n",
594-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER));
595-
dev_info(gus->card->dev,
596-
" -S- MPU-401 emul. control A/B = 0x%x/0x%x\n",
597-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A),
598-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B));
599-
dev_info(gus->card->dev,
600-
" -S- emulation IRQ = 0x%x\n",
601-
snd_gf1_i_look8(gus, SNDRV_GF1_GB_EMULATION_IRQ));
602-
}
603-
}
604-
#endif /* 0 */
605-
606-
#endif

sound/isa/gus/gus_main.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ MODULE_LICENSE("GPL");
2222

2323
static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches);
2424

25-
int snd_gus_use_inc(struct snd_gus_card * gus)
26-
{
27-
if (!try_module_get(gus->card->module))
28-
return 0;
29-
return 1;
30-
}
31-
32-
void snd_gus_use_dec(struct snd_gus_card * gus)
33-
{
34-
module_put(gus->card->module);
35-
}
36-
3725
static int snd_gus_joystick_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
3826
{
3927
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
@@ -443,8 +431,6 @@ EXPORT_SYMBOL(snd_gf1_new_mixer);
443431
/* gus_pcm.c */
444432
EXPORT_SYMBOL(snd_gf1_pcm_new);
445433
/* gus.c */
446-
EXPORT_SYMBOL(snd_gus_use_inc);
447-
EXPORT_SYMBOL(snd_gus_use_dec);
448434
EXPORT_SYMBOL(snd_gus_create);
449435
EXPORT_SYMBOL(snd_gus_initialize);
450436
/* gus_irq.c */

0 commit comments

Comments
 (0)