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

ALSA: ice1712: More constifications

Apply const prefix to each possible place: the EEPROM tables, the
static string arrays, the init verb tables, etc.

Just for minor optimization and no functional changes.

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

+38 -38
+4 -4
sound/pci/ice1712/aureon.c
··· 2133 2133 * hence the driver needs to sets up it properly. 2134 2134 */ 2135 2135 2136 - static unsigned char aureon51_eeprom[] = { 2136 + static const unsigned char aureon51_eeprom[] = { 2137 2137 [ICE_EEP2_SYSCONF] = 0x0a, /* clock 512, spdif-in/ADC, 3DACs */ 2138 2138 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 2139 2139 [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ ··· 2149 2149 [ICE_EEP2_GPIO_STATE2] = 0x00, 2150 2150 }; 2151 2151 2152 - static unsigned char aureon71_eeprom[] = { 2152 + static const unsigned char aureon71_eeprom[] = { 2153 2153 [ICE_EEP2_SYSCONF] = 0x0b, /* clock 512, spdif-in/ADC, 4DACs */ 2154 2154 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 2155 2155 [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ ··· 2166 2166 }; 2167 2167 #define prodigy71_eeprom aureon71_eeprom 2168 2168 2169 - static unsigned char aureon71_universe_eeprom[] = { 2169 + static const unsigned char aureon71_universe_eeprom[] = { 2170 2170 [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, spdif-in/ADC, 2171 2171 * 4DACs 2172 2172 */ ··· 2184 2184 [ICE_EEP2_GPIO_STATE2] = 0x00, 2185 2185 }; 2186 2186 2187 - static unsigned char prodigy71lt_eeprom[] = { 2187 + static const unsigned char prodigy71lt_eeprom[] = { 2188 2188 [ICE_EEP2_SYSCONF] = 0x4b, /* clock 384, spdif-in/ADC, 4DACs */ 2189 2189 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 2190 2190 [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */
+3 -3
sound/pci/ice1712/juli.c
··· 397 397 }, 398 398 }; 399 399 400 - static char *slave_vols[] = { 400 + static const char * const slave_vols[] = { 401 401 PCM_VOLUME, 402 402 MONITOR_AN_IN_VOLUME, 403 403 MONITOR_DIG_IN_VOLUME, ··· 420 420 421 421 static void add_slaves(struct snd_card *card, 422 422 struct snd_kcontrol *master, 423 - char * const *list) 423 + const char * const *list) 424 424 { 425 425 for (; *list; list++) { 426 426 struct snd_kcontrol *slave = ctl_find(card, *list); ··· 651 651 * hence the driver needs to sets up it properly. 652 652 */ 653 653 654 - static unsigned char juli_eeprom[] = { 654 + static const unsigned char juli_eeprom[] = { 655 655 [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, 1xADC, 1xDACs, 656 656 SPDIF in */ 657 657 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
+5 -5
sound/pci/ice1712/maya44.c
··· 116 116 unsigned char mux_bits[2]; /* extra bits for ADC mute */ 117 117 }; 118 118 119 - static struct maya_vol_info vol_info[WM_NUM_VOLS] = { 119 + static const struct maya_vol_info vol_info[WM_NUM_VOLS] = { 120 120 [WM_VOL_HP] = { 121 121 .maxval = 80, 122 122 .regs = { WM8776_REG_HEADPHONE_L, WM8776_REG_HEADPHONE_R }, ··· 158 158 struct snd_ctl_elem_info *uinfo) 159 159 { 160 160 unsigned int idx = kcontrol->private_value; 161 - struct maya_vol_info *vol = &vol_info[idx]; 161 + const struct maya_vol_info *vol = &vol_info[idx]; 162 162 163 163 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 164 164 uinfo->count = 2; ··· 189 189 struct snd_wm8776 *wm = 190 190 &chip->wm[snd_ctl_get_ioff(kcontrol, &ucontrol->id)]; 191 191 unsigned int idx = kcontrol->private_value; 192 - struct maya_vol_info *vol = &vol_info[idx]; 192 + const struct maya_vol_info *vol = &vol_info[idx]; 193 193 unsigned int val, data; 194 194 int ch, changed = 0; 195 195 ··· 662 662 /* 663 663 * chip addresses on I2C bus 664 664 */ 665 - static unsigned char wm8776_addr[2] = { 665 + static const unsigned char wm8776_addr[2] = { 666 666 0x34, 0x36, /* codec 0 & 1 */ 667 667 }; 668 668 ··· 712 712 * hence the driver needs to sets up it properly. 713 713 */ 714 714 715 - static unsigned char maya44_eeprom[] = { 715 + static const unsigned char maya44_eeprom[] = { 716 716 [ICE_EEP2_SYSCONF] = 0x45, 717 717 /* clock xin1=49.152MHz, mpu401, 2 stereo ADCs+DACs */ 718 718 [ICE_EEP2_ACLINK] = 0x80,
+2 -2
sound/pci/ice1712/phase.c
··· 157 157 return 0; 158 158 } 159 159 160 - static unsigned char phase22_eeprom[] = { 160 + static const unsigned char phase22_eeprom[] = { 161 161 [ICE_EEP2_SYSCONF] = 0x28, /* clock 512, mpu 401, 162 162 spdif-in/1xADC, 1xDACs */ 163 163 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ ··· 174 174 [ICE_EEP2_GPIO_STATE2] = 0x00, 175 175 }; 176 176 177 - static unsigned char phase28_eeprom[] = { 177 + static const unsigned char phase28_eeprom[] = { 178 178 [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, 179 179 spdif-in/1xADC, 4xDACs */ 180 180 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
+1 -1
sound/pci/ice1712/pontis.c
··· 778 778 * hence the driver needs to sets up it properly. 779 779 */ 780 780 781 - static unsigned char pontis_eeprom[] = { 781 + static const unsigned char pontis_eeprom[] = { 782 782 [ICE_EEP2_SYSCONF] = 0x08, /* clock 256, mpu401, spdif-in/ADC, 1DAC */ 783 783 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 784 784 [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit, 192k */
+1 -1
sound/pci/ice1712/prodigy192.c
··· 753 753 * hence the driver needs to sets up it properly. 754 754 */ 755 755 756 - static unsigned char prodigy71_eeprom[] = { 756 + static const unsigned char prodigy71_eeprom[] = { 757 757 [ICE_EEP2_SYSCONF] = 0x6a, /* 49MHz crystal, mpu401, 758 758 * spdif-in+ 1 stereo ADC, 759 759 * 3 stereo DACs
+8 -8
sound/pci/ice1712/prodigy_hifi.c
··· 930 930 931 931 static void wm8766_init(struct snd_ice1712 *ice) 932 932 { 933 - static unsigned short wm8766_inits[] = { 933 + static const unsigned short wm8766_inits[] = { 934 934 WM8766_RESET, 0x0000, 935 935 WM8766_DAC_CTRL, 0x0120, 936 936 WM8766_INT_CTRL, 0x0022, /* I2S Normal Mode, 24 bit */ ··· 953 953 954 954 static void wm8776_init(struct snd_ice1712 *ice) 955 955 { 956 - static unsigned short wm8776_inits[] = { 956 + static const unsigned short wm8776_inits[] = { 957 957 /* These come first to reduce init pop noise */ 958 958 WM_ADC_MUX, 0x0003, /* ADC mute */ 959 959 /* 0x00c0 replaced by 0x0003 */ ··· 973 973 #ifdef CONFIG_PM_SLEEP 974 974 static int prodigy_hifi_resume(struct snd_ice1712 *ice) 975 975 { 976 - static unsigned short wm8776_reinit_registers[] = { 976 + static const unsigned short wm8776_reinit_registers[] = { 977 977 WM_MASTER_CTRL, 978 978 WM_DAC_INT, 979 979 WM_ADC_INT, ··· 1033 1033 */ 1034 1034 static int prodigy_hifi_init(struct snd_ice1712 *ice) 1035 1035 { 1036 - static unsigned short wm8776_defaults[] = { 1036 + static const unsigned short wm8776_defaults[] = { 1037 1037 WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */ 1038 1038 WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */ 1039 1039 WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */ ··· 1108 1108 */ 1109 1109 static void ak4396_init(struct snd_ice1712 *ice) 1110 1110 { 1111 - static unsigned short ak4396_inits[] = { 1111 + static const unsigned short ak4396_inits[] = { 1112 1112 AK4396_CTRL1, 0x87, /* I2S Normal Mode, 24 bit */ 1113 1113 AK4396_CTRL2, 0x02, 1114 1114 AK4396_CTRL3, 0x00, ··· 1180 1180 } 1181 1181 1182 1182 1183 - static unsigned char prodigy71hifi_eeprom[] = { 1183 + static const unsigned char prodigy71hifi_eeprom[] = { 1184 1184 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ 1185 1185 0x80, /* ACLINK: I2S */ 1186 1186 0xfc, /* I2S: vol, 96k, 24bit, 192k */ ··· 1196 1196 0x00, /* GPIO_STATE2 */ 1197 1197 }; 1198 1198 1199 - static unsigned char prodigyhd2_eeprom[] = { 1199 + static const unsigned char prodigyhd2_eeprom[] = { 1200 1200 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ 1201 1201 0x80, /* ACLINK: I2S */ 1202 1202 0xfc, /* I2S: vol, 96k, 24bit, 192k */ ··· 1212 1212 0x00, /* GPIO_STATE2 */ 1213 1213 }; 1214 1214 1215 - static unsigned char fortissimo4_eeprom[] = { 1215 + static const unsigned char fortissimo4_eeprom[] = { 1216 1216 0x43, /* SYSCONF: clock 512, ADC, 4DACs */ 1217 1217 0x80, /* ACLINK: I2S */ 1218 1218 0xfc, /* I2S: vol, 96k, 24bit, 192k */
+1 -1
sound/pci/ice1712/psc724.c
··· 420 420 } 421 421 422 422 /* PSC724 has buggy EEPROM (no 96&192kHz, all FFh GPIOs), so override it here */ 423 - static unsigned char psc724_eeprom[] = { 423 + static const unsigned char psc724_eeprom[] = { 424 424 [ICE_EEP2_SYSCONF] = 0x42, /* 49.152MHz, 1 ADC, 3 DACs */ 425 425 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 426 426 [ICE_EEP2_I2S] = 0xf0, /* I2S volume, 96kHz, 24bit */
+4 -4
sound/pci/ice1712/quartet.c
··· 657 657 .get_register = get_##xreg,\ 658 658 .texts = {xtext1, xtext2} } 659 659 660 - static struct qtet_kcontrol_private qtet_privates[] = { 660 + static const struct qtet_kcontrol_private qtet_privates[] = { 661 661 PRIV_ENUM2(IN12_SEL, CPLD_IN12_SEL, cpld, "An In 1/2", "An In 3/4"), 662 662 PRIV_ENUM2(IN34_SEL, CPLD_IN34_SEL, cpld, "An In 3/4", "IEC958 In"), 663 663 PRIV_ENUM2(AIN34_SEL, SCR_AIN34_SEL, scr, "Line In 3/4", "Hi-Z"), ··· 757 757 QTET_CONTROL("Output 3/4 to Monitor 1/2", sw, OUT34_MON12), 758 758 }; 759 759 760 - static char *slave_vols[] = { 760 + static const char * const slave_vols[] = { 761 761 PCM_12_PLAYBACK_VOLUME, 762 762 PCM_34_PLAYBACK_VOLUME, 763 763 NULL ··· 777 777 } 778 778 779 779 static void add_slaves(struct snd_card *card, 780 - struct snd_kcontrol *master, char * const *list) 780 + struct snd_kcontrol *master, const char * const *list) 781 781 { 782 782 for (; *list; list++) { 783 783 struct snd_kcontrol *slave = ctl_find(card, *list); ··· 1053 1053 return 0; 1054 1054 } 1055 1055 1056 - static unsigned char qtet_eeprom[] = { 1056 + static const unsigned char qtet_eeprom[] = { 1057 1057 [ICE_EEP2_SYSCONF] = 0x28, /* clock 256(24MHz), mpu401, 1xADC, 1058 1058 1xDACs, SPDIF in */ 1059 1059 [ICE_EEP2_ACLINK] = 0x80, /* I2S */
+4 -4
sound/pci/ice1712/se.c
··· 245 245 static void se200pci_WM8776_set_input_selector(struct snd_ice1712 *ice, 246 246 unsigned int sel) 247 247 { 248 - static unsigned char vals[] = { 248 + static const unsigned char vals[] = { 249 249 /* LINE, CD, MIC, ALL, GND */ 250 250 0x10, 0x04, 0x08, 0x1c, 0x03 251 251 }; ··· 288 288 static void se200pci_WM8776_init(struct snd_ice1712 *ice) 289 289 { 290 290 int i; 291 - static unsigned short default_values[] = { 291 + static const unsigned short default_values[] = { 292 292 0x100, 0x100, 0x100, 293 293 0x100, 0x100, 0x100, 294 294 0x000, 0x090, 0x000, 0x000, ··· 701 701 /* entry point */ 702 702 /****************************************************************************/ 703 703 704 - static unsigned char se200pci_eeprom[] = { 704 + static const unsigned char se200pci_eeprom[] = { 705 705 [ICE_EEP2_SYSCONF] = 0x4b, /* 49.152Hz, spdif-in/ADC, 4DACs */ 706 706 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 707 707 [ICE_EEP2_I2S] = 0x78, /* 96k-ok, 24bit, 192k-ok */ ··· 720 720 [ICE_EEP2_GPIO_STATE2] = 0x07, /* WM8766 ML/MC/MD */ 721 721 }; 722 722 723 - static unsigned char se90pci_eeprom[] = { 723 + static const unsigned char se90pci_eeprom[] = { 724 724 [ICE_EEP2_SYSCONF] = 0x4b, /* 49.152Hz, spdif-in/ADC, 4DACs */ 725 725 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ 726 726 [ICE_EEP2_I2S] = 0x78, /* 96k-ok, 24bit, 192k-ok */
+2 -2
sound/pci/ice1712/vt1720_mobo.c
··· 39 39 40 40 /* EEPROM image */ 41 41 42 - static unsigned char k8x800_eeprom[] = { 42 + static const unsigned char k8x800_eeprom[] = { 43 43 [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ 44 44 [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ 45 45 [ICE_EEP2_I2S] = 0x00, /* - */ ··· 55 55 [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */ 56 56 }; 57 57 58 - static unsigned char sn25p_eeprom[] = { 58 + static const unsigned char sn25p_eeprom[] = { 59 59 [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ 60 60 [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ 61 61 [ICE_EEP2_I2S] = 0x00, /* - */
+3 -3
sound/pci/ice1712/wtm.c
··· 567 567 568 568 static int wtm_init(struct snd_ice1712 *ice) 569 569 { 570 - static unsigned short stac_inits_wtm[] = { 570 + static const unsigned short stac_inits_wtm[] = { 571 571 STAC946X_RESET, 0, 572 572 STAC946X_MASTER_CLOCKING, 0x11, 573 573 (unsigned short)-1 574 574 }; 575 - unsigned short *p; 575 + const unsigned short *p; 576 576 struct wtm_spec *spec; 577 577 578 578 /*WTM 192M*/ ··· 599 599 } 600 600 601 601 602 - static unsigned char wtm_eeprom[] = { 602 + static const unsigned char wtm_eeprom[] = { 603 603 [ICE_EEP2_SYSCONF] = 0x67, /*SYSCONF: clock 192KHz, mpu401, 604 604 4ADC, 8DAC */ 605 605 [ICE_EEP2_ACLINK] = 0x80, /* ACLINK : I2S */