Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3b827e0 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Takashi Iwai
Browse files

ALSA: pci: constify snd_kcontrol_new structures



Declare snd_kcontrol_new structures as const as they are only passed as
an argument to the function snd_ctl_new1. This argument is of type
const, so snd_kcontrol_new structures having the same property can be
made const too.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_kcontrol_new i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1;
@@
snd_ctl_new1(&i@p,e1)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_kcontrol_new i;

Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 34371d23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -846,7 +846,7 @@ snd_vortex_a3d_filter_put(struct snd_kcontrol *kcontrol,
	return changed;
}

static struct snd_kcontrol_new vortex_a3d_kcontrol = {
static const struct snd_kcontrol_new vortex_a3d_kcontrol = {
	.iface = SNDRV_CTL_ELEM_IFACE_PCM,
	.name = "Playback PCM advanced processing",
	.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+3 −3
Original line number Diff line number Diff line
@@ -757,7 +757,7 @@ snd_vortex_eqtoggle_put(struct snd_kcontrol *kcontrol,
	return 1;		/* Allways changes */
}

static struct snd_kcontrol_new vortex_eqtoggle_kcontrol = {
static const struct snd_kcontrol_new vortex_eqtoggle_kcontrol = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "EQ Enable",
	.index = 0,
@@ -815,7 +815,7 @@ snd_vortex_eq_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucon
	return changed;
}

static struct snd_kcontrol_new vortex_eq_kcontrol = {
static const struct snd_kcontrol_new vortex_eq_kcontrol = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "                        .",
	.index = 0,
@@ -855,7 +855,7 @@ snd_vortex_peaks_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *u
	return 0;
}

static struct snd_kcontrol_new vortex_levels_kcontrol = {
static const struct snd_kcontrol_new vortex_levels_kcontrol = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "EQ Peaks",
	.access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
+1 −1
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ static int snd_vortex_pcm_vol_put(struct snd_kcontrol *kcontrol,

static const DECLARE_TLV_DB_MINMAX(vortex_pcm_vol_db_scale, -9600, 2400);

static struct snd_kcontrol_new snd_vortex_pcm_vol = {
static const struct snd_kcontrol_new snd_vortex_pcm_vol = {
	.iface = SNDRV_CTL_ELEM_IFACE_PCM,
	.name = "PCM Playback Volume",
	.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static const struct snd_pcm_ops snd_aw2_capture_ops = {
	.pointer = snd_aw2_pcm_pointer_capture,
};

static struct snd_kcontrol_new aw2_control = {
static const struct snd_kcontrol_new aw2_control = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "PCM Capture Route",
	.index = 0,
+3 −3
Original line number Diff line number Diff line
@@ -598,7 +598,7 @@ static int snd_bt87x_capture_volume_put(struct snd_kcontrol *kcontrol,
	return changed;
}

static struct snd_kcontrol_new snd_bt87x_capture_volume = {
static const struct snd_kcontrol_new snd_bt87x_capture_volume = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Capture Volume",
	.info = snd_bt87x_capture_volume_info,
@@ -634,7 +634,7 @@ static int snd_bt87x_capture_boost_put(struct snd_kcontrol *kcontrol,
	return changed;
}

static struct snd_kcontrol_new snd_bt87x_capture_boost = {
static const struct snd_kcontrol_new snd_bt87x_capture_boost = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Capture Boost",
	.info = snd_bt87x_capture_boost_info,
@@ -676,7 +676,7 @@ static int snd_bt87x_capture_source_put(struct snd_kcontrol *kcontrol,
	return changed;
}

static struct snd_kcontrol_new snd_bt87x_capture_source = {
static const struct snd_kcontrol_new snd_bt87x_capture_source = {
	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
	.name = "Capture Source",
	.info = snd_bt87x_capture_source_info,
Loading