Commit 0da2c47a authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 2eccd408
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ static int snd_cs8427_spdif_mask_get(struct snd_kcontrol *kcontrol,
	return 0;
}

static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
static const struct snd_kcontrol_new snd_cs8427_iec958_controls[] = {
{
	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
	.info =		snd_cs8427_in_status_info,
+1 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ static int snd_ak4113_spdif_qget(struct snd_kcontrol *kcontrol,
}

/* Don't forget to change AK4113_CONTROLS define!!! */
static struct snd_kcontrol_new snd_ak4113_iec958_controls[] = {
static const struct snd_kcontrol_new snd_ak4113_iec958_controls[] = {
{
	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
	.name =		"IEC958 Parity Errors",
+1 −1
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ static int snd_ak4114_spdif_qget(struct snd_kcontrol *kcontrol,
}

/* Don't forget to change AK4114_CONTROLS define!!! */
static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = {
static const struct snd_kcontrol_new snd_ak4114_iec958_controls[] = {
{
	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
	.name =		"IEC958 Parity Errors",
+1 −1
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ static int snd_ak4117_spdif_qget(struct snd_kcontrol *kcontrol,
}

/* Don't forget to change AK4117_CONTROLS define!!! */
static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
static const struct snd_kcontrol_new snd_ak4117_iec958_controls[] = {
{
	.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
	.name =		"IEC958 Parity Errors",
+2 −2
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ static int snd_tea6330t_put_treble(struct snd_kcontrol *kcontrol,
	return change;
}

static struct snd_kcontrol_new snd_tea6330t_controls[] = {
static const struct snd_kcontrol_new snd_tea6330t_controls[] = {
TEA6330T_MASTER_SWITCH("Master Playback Switch", 0),
TEA6330T_MASTER_VOLUME("Master Playback Volume", 0),
TEA6330T_BASS("Tone Control - Bass", 0),
@@ -278,7 +278,7 @@ int snd_tea6330t_update_mixer(struct snd_card *card,
{
	struct snd_i2c_device *device;
	struct tea6330t *tea;
	struct snd_kcontrol_new *knew;
	const struct snd_kcontrol_new *knew;
	unsigned int idx;
	int err = -ENOMEM;
	u8 default_treble, default_bass;