Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 e5723b41abe5 ("[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>

authored by

Dr. David Alan Gilbert and committed by
Takashi Iwai
5d51fdd1 28a09d9e

-249
-6
include/sound/gus.h
··· 578 578 579 579 int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index); 580 580 581 - #ifdef CONFIG_SND_DEBUG 582 - extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus); 583 - #endif 584 - 585 581 /* gus.c */ 586 582 587 - int snd_gus_use_inc(struct snd_gus_card * gus); 588 - void snd_gus_use_dec(struct snd_gus_card * gus); 589 583 int snd_gus_create(struct snd_card *card, 590 584 unsigned long port, 591 585 int irq, int dma1, int dma2,
-229
sound/isa/gus/gus_io.c
··· 228 228 return res; 229 229 } 230 230 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 - 274 231 void snd_gf1_dram_addr(struct snd_gus_card * gus, unsigned int addr) 275 232 { 276 233 outb(0x43, gus->gf1.reg_regsel); ··· 375 418 udelay(100); 376 419 } 377 420 } 378 - 379 - #ifdef CONFIG_SND_DEBUG 380 - 381 - void snd_gf1_print_voice_registers(struct snd_gus_card * gus) 382 - { 383 - unsigned char mode; 384 - int voice, ctrl; 385 - 386 - voice = gus->gf1.active_voice; 387 - dev_info(gus->card->dev, 388 - " -%i- GF1 voice ctrl, ramp ctrl = 0x%x, 0x%x\n", 389 - voice, ctrl = snd_gf1_i_read8(gus, 0), snd_gf1_i_read8(gus, 0x0d)); 390 - dev_info(gus->card->dev, 391 - " -%i- GF1 frequency = 0x%x\n", 392 - voice, snd_gf1_i_read16(gus, 1)); 393 - dev_info(gus->card->dev, 394 - " -%i- GF1 loop start, end = 0x%x (0x%x), 0x%x (0x%x)\n", 395 - voice, snd_gf1_i_read_addr(gus, 2, ctrl & 4), 396 - snd_gf1_i_read_addr(gus, 2, (ctrl & 4) ^ 4), 397 - snd_gf1_i_read_addr(gus, 4, ctrl & 4), 398 - snd_gf1_i_read_addr(gus, 4, (ctrl & 4) ^ 4)); 399 - dev_info(gus->card->dev, 400 - " -%i- GF1 ramp start, end, rate = 0x%x, 0x%x, 0x%x\n", 401 - voice, snd_gf1_i_read8(gus, 7), snd_gf1_i_read8(gus, 8), 402 - snd_gf1_i_read8(gus, 6)); 403 - dev_info(gus->card->dev, 404 - " -%i- GF1 volume = 0x%x\n", 405 - voice, snd_gf1_i_read16(gus, 9)); 406 - dev_info(gus->card->dev, 407 - " -%i- GF1 position = 0x%x (0x%x)\n", 408 - voice, snd_gf1_i_read_addr(gus, 0x0a, ctrl & 4), 409 - snd_gf1_i_read_addr(gus, 0x0a, (ctrl & 4) ^ 4)); 410 - if (gus->interwave && snd_gf1_i_read8(gus, 0x19) & 0x01) { /* enhanced mode */ 411 - mode = snd_gf1_i_read8(gus, 0x15); 412 - dev_info(gus->card->dev, 413 - " -%i- GFA1 mode = 0x%x\n", 414 - voice, mode); 415 - if (mode & 0x01) { /* Effect processor */ 416 - dev_info(gus->card->dev, 417 - " -%i- GFA1 effect address = 0x%x\n", 418 - voice, snd_gf1_i_read_addr(gus, 0x11, ctrl & 4)); 419 - dev_info(gus->card->dev, 420 - " -%i- GFA1 effect volume = 0x%x\n", 421 - voice, snd_gf1_i_read16(gus, 0x16)); 422 - dev_info(gus->card->dev, 423 - " -%i- GFA1 effect volume final = 0x%x\n", 424 - voice, snd_gf1_i_read16(gus, 0x1d)); 425 - dev_info(gus->card->dev, 426 - " -%i- GFA1 effect accumulator = 0x%x\n", 427 - voice, snd_gf1_i_read8(gus, 0x14)); 428 - } 429 - if (mode & 0x20) { 430 - dev_info(gus->card->dev, 431 - " -%i- GFA1 left offset = 0x%x (%i)\n", 432 - voice, snd_gf1_i_read16(gus, 0x13), 433 - snd_gf1_i_read16(gus, 0x13) >> 4); 434 - dev_info(gus->card->dev, 435 - " -%i- GFA1 left offset final = 0x%x (%i)\n", 436 - voice, snd_gf1_i_read16(gus, 0x1c), 437 - snd_gf1_i_read16(gus, 0x1c) >> 4); 438 - dev_info(gus->card->dev, 439 - " -%i- GFA1 right offset = 0x%x (%i)\n", 440 - voice, snd_gf1_i_read16(gus, 0x0c), 441 - snd_gf1_i_read16(gus, 0x0c) >> 4); 442 - dev_info(gus->card->dev, 443 - " -%i- GFA1 right offset final = 0x%x (%i)\n", 444 - voice, snd_gf1_i_read16(gus, 0x1b), 445 - snd_gf1_i_read16(gus, 0x1b) >> 4); 446 - } else 447 - dev_info(gus->card->dev, 448 - " -%i- GF1 pan = 0x%x\n", 449 - voice, snd_gf1_i_read8(gus, 0x0c)); 450 - } else 451 - dev_info(gus->card->dev, 452 - " -%i- GF1 pan = 0x%x\n", 453 - voice, snd_gf1_i_read8(gus, 0x0c)); 454 - } 455 - 456 - #if 0 457 - 458 - void snd_gf1_print_global_registers(struct snd_gus_card * gus) 459 - { 460 - unsigned char global_mode = 0x00; 461 - 462 - dev_info(gus->card->dev, 463 - " -G- GF1 active voices = 0x%x\n", 464 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_ACTIVE_VOICES)); 465 - if (gus->interwave) { 466 - global_mode = snd_gf1_i_read8(gus, SNDRV_GF1_GB_GLOBAL_MODE); 467 - dev_info(gus->card->dev, 468 - " -G- GF1 global mode = 0x%x\n", 469 - global_mode); 470 - } 471 - if (global_mode & 0x02) /* LFO enabled? */ 472 - dev_info(gus->card->dev, 473 - " -G- GF1 LFO base = 0x%x\n", 474 - snd_gf1_i_look16(gus, SNDRV_GF1_GW_LFO_BASE)); 475 - dev_info(gus->card->dev, 476 - " -G- GF1 voices IRQ read = 0x%x\n", 477 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_VOICES_IRQ_READ)); 478 - dev_info(gus->card->dev, 479 - " -G- GF1 DRAM DMA control = 0x%x\n", 480 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_CONTROL)); 481 - dev_info(gus->card->dev, 482 - " -G- GF1 DRAM DMA high/low = 0x%x/0x%x\n", 483 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_DMA_HIGH), 484 - snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_DMA_LOW)); 485 - dev_info(gus->card->dev, 486 - " -G- GF1 DRAM IO high/low = 0x%x/0x%x\n", 487 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_DRAM_IO_HIGH), 488 - snd_gf1_i_read16(gus, SNDRV_GF1_GW_DRAM_IO_LOW)); 489 - if (!gus->interwave) 490 - dev_info(gus->card->dev, 491 - " -G- GF1 record DMA control = 0x%x\n", 492 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_REC_DMA_CONTROL)); 493 - dev_info(gus->card->dev, 494 - " -G- GF1 DRAM IO 16 = 0x%x\n", 495 - snd_gf1_i_look16(gus, SNDRV_GF1_GW_DRAM_IO16)); 496 - if (gus->gf1.enh_mode) { 497 - dev_info(gus->card->dev, 498 - " -G- GFA1 memory config = 0x%x\n", 499 - snd_gf1_i_look16(gus, SNDRV_GF1_GW_MEMORY_CONFIG)); 500 - dev_info(gus->card->dev, 501 - " -G- GFA1 memory control = 0x%x\n", 502 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_MEMORY_CONTROL)); 503 - dev_info(gus->card->dev, 504 - " -G- GFA1 FIFO record base = 0x%x\n", 505 - snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR)); 506 - dev_info(gus->card->dev, 507 - " -G- GFA1 FIFO playback base = 0x%x\n", 508 - snd_gf1_i_look16(gus, SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR)); 509 - dev_info(gus->card->dev, 510 - " -G- GFA1 interleave control = 0x%x\n", 511 - snd_gf1_i_look16(gus, SNDRV_GF1_GW_INTERLEAVE)); 512 - } 513 - } 514 - 515 - void snd_gf1_print_setup_registers(struct snd_gus_card * gus) 516 - { 517 - dev_info(gus->card->dev, 518 - " -S- mix control = 0x%x\n", 519 - inb(GUSP(gus, MIXCNTRLREG))); 520 - dev_info(gus->card->dev, 521 - " -S- IRQ status = 0x%x\n", 522 - inb(GUSP(gus, IRQSTAT))); 523 - dev_info(gus->card->dev, 524 - " -S- timer control = 0x%x\n", 525 - inb(GUSP(gus, TIMERCNTRL))); 526 - dev_info(gus->card->dev, 527 - " -S- timer data = 0x%x\n", 528 - inb(GUSP(gus, TIMERDATA))); 529 - dev_info(gus->card->dev, 530 - " -S- status read = 0x%x\n", 531 - inb(GUSP(gus, REGCNTRLS))); 532 - dev_info(gus->card->dev, 533 - " -S- Sound Blaster control = 0x%x\n", 534 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_SOUND_BLASTER_CONTROL)); 535 - dev_info(gus->card->dev, 536 - " -S- AdLib timer 1/2 = 0x%x/0x%x\n", 537 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_1), 538 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_ADLIB_TIMER_2)); 539 - dev_info(gus->card->dev, 540 - " -S- reset = 0x%x\n", 541 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_RESET)); 542 - if (gus->interwave) { 543 - dev_info(gus->card->dev, 544 - " -S- compatibility = 0x%x\n", 545 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_COMPATIBILITY)); 546 - dev_info(gus->card->dev, 547 - " -S- decode control = 0x%x\n", 548 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_DECODE_CONTROL)); 549 - dev_info(gus->card->dev, 550 - " -S- version number = 0x%x\n", 551 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_VERSION_NUMBER)); 552 - dev_info(gus->card->dev, 553 - " -S- MPU-401 emul. control A/B = 0x%x/0x%x\n", 554 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_A), 555 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_MPU401_CONTROL_B)); 556 - dev_info(gus->card->dev, 557 - " -S- emulation IRQ = 0x%x\n", 558 - snd_gf1_i_look8(gus, SNDRV_GF1_GB_EMULATION_IRQ)); 559 - } 560 - } 561 - #endif /* 0 */ 562 - 563 - #endif
-14
sound/isa/gus/gus_main.c
··· 22 22 23 23 static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches); 24 24 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 - 37 25 static int snd_gus_joystick_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) 38 26 { 39 27 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; ··· 431 443 /* gus_pcm.c */ 432 444 EXPORT_SYMBOL(snd_gf1_pcm_new); 433 445 /* gus.c */ 434 - EXPORT_SYMBOL(snd_gus_use_inc); 435 - EXPORT_SYMBOL(snd_gus_use_dec); 436 446 EXPORT_SYMBOL(snd_gus_create); 437 447 EXPORT_SYMBOL(snd_gus_initialize); 438 448 /* gus_irq.c */