Commit b4e5e707 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: pci: 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-38-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 35ace5e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_master, -6200, 200, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_mono, -2800, 400, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_input, -5000, 200, 0);

static struct snd_kcontrol_new snd_ak4531_controls[] = {
static const struct snd_kcontrol_new snd_ak4531_controls[] = {

AK4531_DOUBLE_TLV("Master Playback Switch", 0,
		  AK4531_LMASTER, AK4531_RMASTER, 7, 7, 1, 1,
+1 −1
Original line number Diff line number Diff line
@@ -1776,7 +1776,7 @@ static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol,
	return change;
}

static struct snd_kcontrol_new snd_ali5451_mixer_spdif[] = {
static const struct snd_kcontrol_new snd_ali5451_mixer_spdif[] = {
	/* spdif aplayback switch */
	/* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */
	ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("Output ",NONE,SWITCH), 0, 0),
+1 −1
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ static int snd_vortex_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
}

/* spdif controls */
static struct snd_kcontrol_new snd_vortex_mixer_spdif[] = {
static const struct snd_kcontrol_new snd_vortex_mixer_spdif[] = {
	{
		.iface =	SNDRV_CTL_ELEM_IFACE_PCM,
		.name =		SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
+1 −1
Original line number Diff line number Diff line
@@ -1094,7 +1094,7 @@ snd_azf3328_put_mixer_enum(struct snd_kcontrol *kcontrol,
	return (nreg != oreg);
}

static struct snd_kcontrol_new snd_azf3328_mixer_controls[] = {
static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] = {
	AZF3328_MIXER_SWITCH("Master Playback Switch", IDX_MIXER_PLAY_MASTER, 15, 1),
	AZF3328_MIXER_VOL_STEREO("Master Playback Volume", IDX_MIXER_PLAY_MASTER, 0x1f, 1),
	AZF3328_MIXER_SWITCH("PCM Playback Switch", IDX_MIXER_WAVEOUT, 15, 1),
+2 −2
Original line number Diff line number Diff line
@@ -550,7 +550,7 @@ static int spi_mute_put(struct snd_kcontrol *kcontrol,
	.private_value = ((chid) << 8) | (reg)			\
}

static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = {
static const struct snd_kcontrol_new snd_ca0106_volume_ctls[] = {
	CA_VOLUME("Analog Front Playback Volume",
		  CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2),
        CA_VOLUME("Analog Rear Playback Volume",
@@ -631,7 +631,7 @@ static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = {
	.private_value = chid					\
}

static struct snd_kcontrol_new snd_ca0106_volume_i2c_adc_ctls[] = {
static const struct snd_kcontrol_new snd_ca0106_volume_i2c_adc_ctls[] = {
        I2C_VOLUME("Phone Capture Volume", 0),
        I2C_VOLUME("Mic Capture Volume", 1),
        I2C_VOLUME("Line in Capture Volume", 2),
Loading