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

ALSA: i2c: Constify snd_kcontrol_new items

Most of snd_kcontrol_new definitions are read-only and passed as-is.
Let's declare them as const for further optimization.

There should be no functional changes by this patch.

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

+6 -6
+1 -1
sound/i2c/cs8427.c
··· 459 459 return 0; 460 460 } 461 461 462 - static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { 462 + static const struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { 463 463 { 464 464 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 465 465 .info = snd_cs8427_in_status_info,
+1 -1
sound/i2c/other/ak4113.c
··· 349 349 } 350 350 351 351 /* Don't forget to change AK4113_CONTROLS define!!! */ 352 - static struct snd_kcontrol_new snd_ak4113_iec958_controls[] = { 352 + static const struct snd_kcontrol_new snd_ak4113_iec958_controls[] = { 353 353 { 354 354 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 355 355 .name = "IEC958 Parity Errors",
+1 -1
sound/i2c/other/ak4114.c
··· 318 318 } 319 319 320 320 /* Don't forget to change AK4114_CONTROLS define!!! */ 321 - static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { 321 + static const struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { 322 322 { 323 323 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 324 324 .name = "IEC958 Parity Errors",
+1 -1
sound/i2c/other/ak4117.c
··· 305 305 } 306 306 307 307 /* Don't forget to change AK4117_CONTROLS define!!! */ 308 - static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { 308 + static const struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { 309 309 { 310 310 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 311 311 .name = "IEC958 Parity Errors",
+2 -2
sound/i2c/tea6330t.c
··· 260 260 return change; 261 261 } 262 262 263 - static struct snd_kcontrol_new snd_tea6330t_controls[] = { 263 + static const struct snd_kcontrol_new snd_tea6330t_controls[] = { 264 264 TEA6330T_MASTER_SWITCH("Master Playback Switch", 0), 265 265 TEA6330T_MASTER_VOLUME("Master Playback Volume", 0), 266 266 TEA6330T_BASS("Tone Control - Bass", 0), ··· 278 278 { 279 279 struct snd_i2c_device *device; 280 280 struct tea6330t *tea; 281 - struct snd_kcontrol_new *knew; 281 + const struct snd_kcontrol_new *knew; 282 282 unsigned int idx; 283 283 int err = -ENOMEM; 284 284 u8 default_treble, default_bass;