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

ALSA: hdspm: More constifications

Apply const prefix to each possible place: the string arrays, the
channel map tables and callers.

Just for minor optimization and no functional changes.

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

+50 -46
+50 -46
sound/pci/rme9652/hdspm.c
··· 637 637 #define HDSPM_SPEED_QUAD 2 638 638 639 639 /* names for speed modes */ 640 - static char *hdspm_speed_names[] = { "single", "double", "quad" }; 640 + static const char * const hdspm_speed_names[] = { "single", "double", "quad" }; 641 641 642 642 static const char *const texts_autosync_aes_tco[] = { "Word Clock", 643 643 "AES1", "AES2", "AES3", "AES4", ··· 684 684 "192 kHz" 685 685 }; 686 686 687 - static char *texts_ports_madi[] = { 687 + static const char * const texts_ports_madi[] = { 688 688 "MADI.1", "MADI.2", "MADI.3", "MADI.4", "MADI.5", "MADI.6", 689 689 "MADI.7", "MADI.8", "MADI.9", "MADI.10", "MADI.11", "MADI.12", 690 690 "MADI.13", "MADI.14", "MADI.15", "MADI.16", "MADI.17", "MADI.18", ··· 699 699 }; 700 700 701 701 702 - static char *texts_ports_raydat_ss[] = { 702 + static const char * const texts_ports_raydat_ss[] = { 703 703 "ADAT1.1", "ADAT1.2", "ADAT1.3", "ADAT1.4", "ADAT1.5", "ADAT1.6", 704 704 "ADAT1.7", "ADAT1.8", "ADAT2.1", "ADAT2.2", "ADAT2.3", "ADAT2.4", 705 705 "ADAT2.5", "ADAT2.6", "ADAT2.7", "ADAT2.8", "ADAT3.1", "ADAT3.2", ··· 710 710 "SPDIF.L", "SPDIF.R" 711 711 }; 712 712 713 - static char *texts_ports_raydat_ds[] = { 713 + static const char * const texts_ports_raydat_ds[] = { 714 714 "ADAT1.1", "ADAT1.2", "ADAT1.3", "ADAT1.4", 715 715 "ADAT2.1", "ADAT2.2", "ADAT2.3", "ADAT2.4", 716 716 "ADAT3.1", "ADAT3.2", "ADAT3.3", "ADAT3.4", ··· 719 719 "SPDIF.L", "SPDIF.R" 720 720 }; 721 721 722 - static char *texts_ports_raydat_qs[] = { 722 + static const char * const texts_ports_raydat_qs[] = { 723 723 "ADAT1.1", "ADAT1.2", 724 724 "ADAT2.1", "ADAT2.2", 725 725 "ADAT3.1", "ADAT3.2", ··· 729 729 }; 730 730 731 731 732 - static char *texts_ports_aio_in_ss[] = { 732 + static const char * const texts_ports_aio_in_ss[] = { 733 733 "Analogue.L", "Analogue.R", 734 734 "AES.L", "AES.R", 735 735 "SPDIF.L", "SPDIF.R", ··· 738 738 "AEB.1", "AEB.2", "AEB.3", "AEB.4" 739 739 }; 740 740 741 - static char *texts_ports_aio_out_ss[] = { 741 + static const char * const texts_ports_aio_out_ss[] = { 742 742 "Analogue.L", "Analogue.R", 743 743 "AES.L", "AES.R", 744 744 "SPDIF.L", "SPDIF.R", ··· 748 748 "AEB.1", "AEB.2", "AEB.3", "AEB.4" 749 749 }; 750 750 751 - static char *texts_ports_aio_in_ds[] = { 751 + static const char * const texts_ports_aio_in_ds[] = { 752 752 "Analogue.L", "Analogue.R", 753 753 "AES.L", "AES.R", 754 754 "SPDIF.L", "SPDIF.R", ··· 756 756 "AEB.1", "AEB.2", "AEB.3", "AEB.4" 757 757 }; 758 758 759 - static char *texts_ports_aio_out_ds[] = { 760 - "Analogue.L", "Analogue.R", 761 - "AES.L", "AES.R", 762 - "SPDIF.L", "SPDIF.R", 763 - "ADAT.1", "ADAT.2", "ADAT.3", "ADAT.4", 764 - "Phone.L", "Phone.R", 765 - "AEB.1", "AEB.2", "AEB.3", "AEB.4" 766 - }; 767 - 768 - static char *texts_ports_aio_in_qs[] = { 769 - "Analogue.L", "Analogue.R", 770 - "AES.L", "AES.R", 771 - "SPDIF.L", "SPDIF.R", 772 - "ADAT.1", "ADAT.2", "ADAT.3", "ADAT.4", 773 - "AEB.1", "AEB.2", "AEB.3", "AEB.4" 774 - }; 775 - 776 - static char *texts_ports_aio_out_qs[] = { 759 + static const char * const texts_ports_aio_out_ds[] = { 777 760 "Analogue.L", "Analogue.R", 778 761 "AES.L", "AES.R", 779 762 "SPDIF.L", "SPDIF.R", ··· 765 782 "AEB.1", "AEB.2", "AEB.3", "AEB.4" 766 783 }; 767 784 768 - static char *texts_ports_aes32[] = { 785 + static const char * const texts_ports_aio_in_qs[] = { 786 + "Analogue.L", "Analogue.R", 787 + "AES.L", "AES.R", 788 + "SPDIF.L", "SPDIF.R", 789 + "ADAT.1", "ADAT.2", "ADAT.3", "ADAT.4", 790 + "AEB.1", "AEB.2", "AEB.3", "AEB.4" 791 + }; 792 + 793 + static const char * const texts_ports_aio_out_qs[] = { 794 + "Analogue.L", "Analogue.R", 795 + "AES.L", "AES.R", 796 + "SPDIF.L", "SPDIF.R", 797 + "ADAT.1", "ADAT.2", "ADAT.3", "ADAT.4", 798 + "Phone.L", "Phone.R", 799 + "AEB.1", "AEB.2", "AEB.3", "AEB.4" 800 + }; 801 + 802 + static const char * const texts_ports_aes32[] = { 769 803 "AES.1", "AES.2", "AES.3", "AES.4", "AES.5", "AES.6", "AES.7", 770 804 "AES.8", "AES.9.", "AES.10", "AES.11", "AES.12", "AES.13", "AES.14", 771 805 "AES.15", "AES.16" ··· 796 796 where the data for that channel can be read/written from/to. 797 797 */ 798 798 799 - static char channel_map_unity_ss[HDSPM_MAX_CHANNELS] = { 799 + static const char channel_map_unity_ss[HDSPM_MAX_CHANNELS] = { 800 800 0, 1, 2, 3, 4, 5, 6, 7, 801 801 8, 9, 10, 11, 12, 13, 14, 15, 802 802 16, 17, 18, 19, 20, 21, 22, 23, ··· 807 807 56, 57, 58, 59, 60, 61, 62, 63 808 808 }; 809 809 810 - static char channel_map_raydat_ss[HDSPM_MAX_CHANNELS] = { 810 + static const char channel_map_raydat_ss[HDSPM_MAX_CHANNELS] = { 811 811 4, 5, 6, 7, 8, 9, 10, 11, /* ADAT 1 */ 812 812 12, 13, 14, 15, 16, 17, 18, 19, /* ADAT 2 */ 813 813 20, 21, 22, 23, 24, 25, 26, 27, /* ADAT 3 */ ··· 820 820 -1, -1, -1, -1, -1, -1, -1, -1, 821 821 }; 822 822 823 - static char channel_map_raydat_ds[HDSPM_MAX_CHANNELS] = { 823 + static const char channel_map_raydat_ds[HDSPM_MAX_CHANNELS] = { 824 824 4, 5, 6, 7, /* ADAT 1 */ 825 825 8, 9, 10, 11, /* ADAT 2 */ 826 826 12, 13, 14, 15, /* ADAT 3 */ ··· 835 835 -1, -1, -1, -1, -1, -1, -1, -1, 836 836 }; 837 837 838 - static char channel_map_raydat_qs[HDSPM_MAX_CHANNELS] = { 838 + static const char channel_map_raydat_qs[HDSPM_MAX_CHANNELS] = { 839 839 4, 5, /* ADAT 1 */ 840 840 6, 7, /* ADAT 2 */ 841 841 8, 9, /* ADAT 3 */ ··· 851 851 -1, -1, -1, -1, -1, -1, -1, -1, 852 852 }; 853 853 854 - static char channel_map_aio_in_ss[HDSPM_MAX_CHANNELS] = { 854 + static const char channel_map_aio_in_ss[HDSPM_MAX_CHANNELS] = { 855 855 0, 1, /* line in */ 856 856 8, 9, /* aes in, */ 857 857 10, 11, /* spdif in */ ··· 865 865 -1, -1, -1, -1, -1, -1, -1, -1, 866 866 }; 867 867 868 - static char channel_map_aio_out_ss[HDSPM_MAX_CHANNELS] = { 868 + static const char channel_map_aio_out_ss[HDSPM_MAX_CHANNELS] = { 869 869 0, 1, /* line out */ 870 870 8, 9, /* aes out */ 871 871 10, 11, /* spdif out */ ··· 880 880 -1, -1, -1, -1, -1, -1, -1, -1, 881 881 }; 882 882 883 - static char channel_map_aio_in_ds[HDSPM_MAX_CHANNELS] = { 883 + static const char channel_map_aio_in_ds[HDSPM_MAX_CHANNELS] = { 884 884 0, 1, /* line in */ 885 885 8, 9, /* aes in */ 886 886 10, 11, /* spdif in */ ··· 895 895 -1, -1, -1, -1, -1, -1, -1, -1 896 896 }; 897 897 898 - static char channel_map_aio_out_ds[HDSPM_MAX_CHANNELS] = { 898 + static const char channel_map_aio_out_ds[HDSPM_MAX_CHANNELS] = { 899 899 0, 1, /* line out */ 900 900 8, 9, /* aes out */ 901 901 10, 11, /* spdif out */ ··· 910 910 -1, -1, -1, -1, -1, -1, -1, -1 911 911 }; 912 912 913 - static char channel_map_aio_in_qs[HDSPM_MAX_CHANNELS] = { 913 + static const char channel_map_aio_in_qs[HDSPM_MAX_CHANNELS] = { 914 914 0, 1, /* line in */ 915 915 8, 9, /* aes in */ 916 916 10, 11, /* spdif in */ ··· 925 925 -1, -1, -1, -1, -1, -1, -1, -1 926 926 }; 927 927 928 - static char channel_map_aio_out_qs[HDSPM_MAX_CHANNELS] = { 928 + static const char channel_map_aio_out_qs[HDSPM_MAX_CHANNELS] = { 929 929 0, 1, /* line out */ 930 930 8, 9, /* aes out */ 931 931 10, 11, /* spdif out */ ··· 941 941 -1, -1, -1, -1, -1, -1, -1, -1 942 942 }; 943 943 944 - static char channel_map_aes32[HDSPM_MAX_CHANNELS] = { 944 + static const char channel_map_aes32[HDSPM_MAX_CHANNELS] = { 945 945 0, 1, 2, 3, 4, 5, 6, 7, 946 946 8, 9, 10, 11, 12, 13, 14, 15, 947 947 -1, -1, -1, -1, -1, -1, -1, -1, ··· 1010 1010 unsigned char max_channels_in; 1011 1011 unsigned char max_channels_out; 1012 1012 1013 - signed char *channel_map_in; 1014 - signed char *channel_map_out; 1013 + const signed char *channel_map_in; 1014 + const signed char *channel_map_out; 1015 1015 1016 - signed char *channel_map_in_ss, *channel_map_in_ds, *channel_map_in_qs; 1017 - signed char *channel_map_out_ss, *channel_map_out_ds, *channel_map_out_qs; 1016 + const signed char *channel_map_in_ss, *channel_map_in_ds, *channel_map_in_qs; 1017 + const signed char *channel_map_out_ss, *channel_map_out_ds, *channel_map_out_qs; 1018 1018 1019 - char **port_names_in; 1020 - char **port_names_out; 1019 + const char * const *port_names_in; 1020 + const char * const *port_names_out; 1021 1021 1022 - char **port_names_in_ss, **port_names_in_ds, **port_names_in_qs; 1023 - char **port_names_out_ss, **port_names_out_ds, **port_names_out_qs; 1022 + const char * const *port_names_in_ss; 1023 + const char * const *port_names_in_ds; 1024 + const char * const *port_names_in_qs; 1025 + const char * const *port_names_out_ss; 1026 + const char * const *port_names_out_ds; 1027 + const char * const *port_names_out_qs; 1024 1028 1025 1029 unsigned char *playback_buffer; /* suitably aligned address */ 1026 1030 unsigned char *capture_buffer; /* suitably aligned address */