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

ALSA: riptide: More constifications

Apply const prefix to each lbus path table definition and its
callers.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-16-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+30 -30
+30 -30
sound/pci/riptide/riptide.c
··· 361 361 enum { SB_CMD = 0, MODEM_CMD, I2S_CMD0, I2S_CMD1, FM_CMD, MAX_CMD }; 362 362 363 363 struct lbuspath { 364 - unsigned char *noconv; 365 - unsigned char *stereo; 366 - unsigned char *mono; 364 + const unsigned char *noconv; 365 + const unsigned char *stereo; 366 + const unsigned char *mono; 367 367 }; 368 368 369 369 struct cmdport { ··· 464 464 465 465 struct pcmhw { /* pcm descriptor */ 466 466 struct lbuspath paths; 467 - unsigned char *lbuspath; 467 + const unsigned char *lbuspath; 468 468 unsigned char source; 469 469 unsigned char intdec[2]; 470 470 unsigned char mixer; ··· 517 517 /* 518 518 */ 519 519 520 - static unsigned char lbusin2out[E2SINK_MAX + 1][2] = { 520 + static const unsigned char lbusin2out[E2SINK_MAX + 1][2] = { 521 521 {NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT, 522 522 LS_NONE2}, 523 523 {NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT, ··· 557 557 LS_NONE2}, 558 558 }; 559 559 560 - static unsigned char lbus_play_opl3[] = { 560 + static const unsigned char lbus_play_opl3[] = { 561 561 DIGITAL_MIXER_IN0 + FM_MIXER, 0xff 562 562 }; 563 - static unsigned char lbus_play_modem[] = { 563 + static const unsigned char lbus_play_modem[] = { 564 564 DIGITAL_MIXER_IN0 + MODEM_MIXER, 0xff 565 565 }; 566 - static unsigned char lbus_play_i2s[] = { 566 + static const unsigned char lbus_play_i2s[] = { 567 567 INTER0_IN + I2S_INTDEC, DIGITAL_MIXER_IN0 + I2S_MIXER, 0xff 568 568 }; 569 - static unsigned char lbus_play_out[] = { 569 + static const unsigned char lbus_play_out[] = { 570 570 PDAC2ACLNK, 0xff 571 571 }; 572 - static unsigned char lbus_play_outhp[] = { 572 + static const unsigned char lbus_play_outhp[] = { 573 573 HNDSPK2ACLNK, 0xff 574 574 }; 575 - static unsigned char lbus_play_noconv1[] = { 575 + static const unsigned char lbus_play_noconv1[] = { 576 576 DIGITAL_MIXER_IN0, 0xff 577 577 }; 578 - static unsigned char lbus_play_stereo1[] = { 578 + static const unsigned char lbus_play_stereo1[] = { 579 579 INTER0_IN, DIGITAL_MIXER_IN0, 0xff 580 580 }; 581 - static unsigned char lbus_play_mono1[] = { 581 + static const unsigned char lbus_play_mono1[] = { 582 582 INTERM0_IN, DIGITAL_MIXER_IN0, 0xff 583 583 }; 584 - static unsigned char lbus_play_noconv2[] = { 584 + static const unsigned char lbus_play_noconv2[] = { 585 585 DIGITAL_MIXER_IN1, 0xff 586 586 }; 587 - static unsigned char lbus_play_stereo2[] = { 587 + static const unsigned char lbus_play_stereo2[] = { 588 588 INTER1_IN, DIGITAL_MIXER_IN1, 0xff 589 589 }; 590 - static unsigned char lbus_play_mono2[] = { 590 + static const unsigned char lbus_play_mono2[] = { 591 591 INTERM1_IN, DIGITAL_MIXER_IN1, 0xff 592 592 }; 593 - static unsigned char lbus_play_noconv3[] = { 593 + static const unsigned char lbus_play_noconv3[] = { 594 594 DIGITAL_MIXER_IN2, 0xff 595 595 }; 596 - static unsigned char lbus_play_stereo3[] = { 596 + static const unsigned char lbus_play_stereo3[] = { 597 597 INTER2_IN, DIGITAL_MIXER_IN2, 0xff 598 598 }; 599 - static unsigned char lbus_play_mono3[] = { 599 + static const unsigned char lbus_play_mono3[] = { 600 600 INTERM2_IN, DIGITAL_MIXER_IN2, 0xff 601 601 }; 602 - static unsigned char lbus_rec_noconv1[] = { 602 + static const unsigned char lbus_rec_noconv1[] = { 603 603 LBUS2ARM_FIFO5, 0xff 604 604 }; 605 - static unsigned char lbus_rec_stereo1[] = { 605 + static const unsigned char lbus_rec_stereo1[] = { 606 606 DECIM0_IN, LBUS2ARM_FIFO5, 0xff 607 607 }; 608 - static unsigned char lbus_rec_mono1[] = { 608 + static const unsigned char lbus_rec_mono1[] = { 609 609 DECIMM3_IN, LBUS2ARM_FIFO5, 0xff 610 610 }; 611 611 612 - static unsigned char play_ids[] = { 4, 1, 2, }; 613 - static unsigned char play_sources[] = { 612 + static const unsigned char play_ids[] = { 4, 1, 2, }; 613 + static const unsigned char play_sources[] = { 614 614 ARM2LBUS_FIFO4, ARM2LBUS_FIFO1, ARM2LBUS_FIFO2, 615 615 }; 616 - static struct lbuspath lbus_play_paths[] = { 616 + static const struct lbuspath lbus_play_paths[] = { 617 617 { 618 618 .noconv = lbus_play_noconv1, 619 619 .stereo = lbus_play_stereo1, ··· 737 737 738 738 static void 739 739 alloclbuspath(struct cmdif *cif, unsigned char source, 740 - unsigned char *path, unsigned char *mixer, unsigned char *s) 740 + const unsigned char *path, unsigned char *mixer, unsigned char *s) 741 741 { 742 742 while (*path != 0xff) { 743 743 unsigned char sink, type; ··· 765 765 } 766 766 } 767 767 if (*path++ & SPLIT_PATH) { 768 - unsigned char *npath = path; 768 + const unsigned char *npath = path; 769 769 770 770 while (*npath != 0xff) 771 771 npath++; ··· 775 775 } 776 776 777 777 static void 778 - freelbuspath(struct cmdif *cif, unsigned char source, unsigned char *path) 778 + freelbuspath(struct cmdif *cif, unsigned char source, const unsigned char *path) 779 779 { 780 780 while (*path != 0xff) { 781 781 unsigned char sink; ··· 787 787 source = lbusin2out[sink][0]; 788 788 } 789 789 if (*path++ & SPLIT_PATH) { 790 - unsigned char *npath = path; 790 + const unsigned char *npath = path; 791 791 792 792 while (*npath != 0xff) 793 793 npath++; ··· 1441 1441 struct snd_pcm_runtime *runtime = substream->runtime; 1442 1442 struct pcmhw *data = get_pcmhwdev(substream); 1443 1443 struct cmdif *cif = chip->cif; 1444 - unsigned char *lbuspath = NULL; 1444 + const unsigned char *lbuspath = NULL; 1445 1445 unsigned int rate, channels; 1446 1446 int err = 0; 1447 1447 snd_pcm_format_t format;