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

ALSA: ice17xx: Constify snd_ice1712_card_info

The snd_ice1712_card_info objects are referred only as read-only.
Let's make them const for further optimization.

There should be no functional changes by this patch.

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

+10 -10
+3 -3
sound/pci/ice1712/ice1712.c
··· 2218 2218 /* 2219 2219 * list of available boards 2220 2220 */ 2221 - static struct snd_ice1712_card_info *card_tables[] = { 2221 + static const struct snd_ice1712_card_info *card_tables[] = { 2222 2222 snd_ice1712_hoontech_cards, 2223 2223 snd_ice1712_delta_cards, 2224 2224 snd_ice1712_ews_cards, ··· 2242 2242 { 2243 2243 int dev = ICE_I2C_EEPROM_ADDR; /* I2C EEPROM device address */ 2244 2244 unsigned int i, size; 2245 - struct snd_ice1712_card_info * const *tbl, *c; 2245 + const struct snd_ice1712_card_info * const *tbl, *c; 2246 2246 2247 2247 if (!modelname || !*modelname) { 2248 2248 ice->eeprom.subvendor = 0; ··· 2587 2587 struct snd_card *card; 2588 2588 struct snd_ice1712 *ice; 2589 2589 int pcm_dev = 0, err; 2590 - struct snd_ice1712_card_info * const *tbl, *c; 2590 + const struct snd_ice1712_card_info * const *tbl, *c; 2591 2591 2592 2592 if (dev >= SNDRV_CARDS) 2593 2593 return -ENODEV;
+1 -1
sound/pci/ice1712/ice1712.h
··· 316 316 struct snd_info_entry *proc_entry; 317 317 318 318 struct snd_ice1712_eeprom eeprom; 319 - struct snd_ice1712_card_info *card_info; 319 + const struct snd_ice1712_card_info *card_info; 320 320 321 321 unsigned int pro_volumes[20]; 322 322 unsigned int omni:1; /* Delta Omni I/O */
+6 -6
sound/pci/ice1712/ice1724.c
··· 2170 2170 * 2171 2171 */ 2172 2172 2173 - static struct snd_ice1712_card_info no_matched; 2173 + static const struct snd_ice1712_card_info no_matched; 2174 2174 2175 2175 2176 2176 /* 2177 2177 ooAoo cards with no controls 2178 2178 */ 2179 - static unsigned char ooaoo_sq210_eeprom[] = { 2179 + static const unsigned char ooaoo_sq210_eeprom[] = { 2180 2180 [ICE_EEP2_SYSCONF] = 0x4c, /* 49MHz crystal, no mpu401, no ADC, 2181 2181 1xDACs */ 2182 2182 [ICE_EEP2_ACLINK] = 0x80, /* I2S */ ··· 2196 2196 }; 2197 2197 2198 2198 2199 - static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { 2199 + static const struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { 2200 2200 { 2201 2201 .name = "ooAoo SQ210a", 2202 2202 .model = "sq210a", ··· 2206 2206 { } /* terminator */ 2207 2207 }; 2208 2208 2209 - static struct snd_ice1712_card_info *card_tables[] = { 2209 + static const struct snd_ice1712_card_info *card_tables[] = { 2210 2210 snd_vt1724_revo_cards, 2211 2211 snd_vt1724_amp_cards, 2212 2212 snd_vt1724_aureon_cards, ··· 2276 2276 { 2277 2277 const int dev = 0xa0; /* EEPROM device address */ 2278 2278 unsigned int i, size; 2279 - struct snd_ice1712_card_info * const *tbl, *c; 2279 + const struct snd_ice1712_card_info * const *tbl, *c; 2280 2280 2281 2281 if (!modelname || !*modelname) { 2282 2282 ice->eeprom.subvendor = 0; ··· 2590 2590 struct snd_card *card; 2591 2591 struct snd_ice1712 *ice; 2592 2592 int pcm_dev = 0, err; 2593 - struct snd_ice1712_card_info * const *tbl, *c; 2593 + const struct snd_ice1712_card_info * const *tbl, *c; 2594 2594 2595 2595 if (dev >= SNDRV_CARDS) 2596 2596 return -ENODEV;