ALSA: ice1712: add const to snd_akm4xxx structures

Declare snd_akm4xxx structures  as const as they are only passed
to the function snd_ice1712_akm4xxx_init. This argument is of type
const, so make the structures const.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
position p;
@@
static struct snd_akm4xxx s@p={...};

@good1@
identifier match.s;
position p;
@@
snd_ice1712_akm4xxx_init(...,&s@p,...)

@bad@
identifier match.s;
position p!={match.p,good1.p};
@@
s@p

@depends on !bad disable optional_qualifier@
identifier match.s;
@@
static
+const
struct snd_akm4xxx s={...};

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Bhumika Goyal 2017-08-04 23:19:30 +05:30 committed by Takashi Iwai
parent 4647e8d512
commit 3135432e42
7 changed files with 18 additions and 18 deletions

View File

@ -445,7 +445,7 @@ static const struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_status =
* initialize the chips on M-Audio cards
*/
static struct snd_akm4xxx akm_audiophile = {
static const struct snd_akm4xxx akm_audiophile = {
.type = SND_AK4528,
.num_adcs = 2,
.num_dacs = 2,
@ -466,7 +466,7 @@ static const struct snd_ak4xxx_private akm_audiophile_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_delta410 = {
static const struct snd_akm4xxx akm_delta410 = {
.type = SND_AK4529,
.num_adcs = 2,
.num_dacs = 8,
@ -487,7 +487,7 @@ static const struct snd_ak4xxx_private akm_delta410_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_delta1010lt = {
static const struct snd_akm4xxx akm_delta1010lt = {
.type = SND_AK4524,
.num_adcs = 8,
.num_dacs = 8,
@ -509,7 +509,7 @@ static const struct snd_ak4xxx_private akm_delta1010lt_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_delta66e = {
static const struct snd_akm4xxx akm_delta66e = {
.type = SND_AK4524,
.num_adcs = 4,
.num_dacs = 4,
@ -532,7 +532,7 @@ static const struct snd_ak4xxx_private akm_delta66e_priv = {
};
static struct snd_akm4xxx akm_delta44 = {
static const struct snd_akm4xxx akm_delta44 = {
.type = SND_AK4524,
.num_adcs = 4,
.num_dacs = 4,
@ -554,7 +554,7 @@ static const struct snd_ak4xxx_private akm_delta44_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_vx442 = {
static const struct snd_akm4xxx akm_vx442 = {
.type = SND_AK4524,
.num_adcs = 4,
.num_dacs = 4,

View File

@ -344,7 +344,7 @@ static void ews88_setup_spdif(struct snd_ice1712 *ice, int rate)
/*
*/
static struct snd_akm4xxx akm_ews88mt = {
static const struct snd_akm4xxx akm_ews88mt = {
.num_adcs = 8,
.num_dacs = 8,
.type = SND_AK4524,
@ -366,7 +366,7 @@ static const struct snd_ak4xxx_private akm_ews88mt_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_ewx2496 = {
static const struct snd_akm4xxx akm_ewx2496 = {
.num_adcs = 2,
.num_dacs = 2,
.type = SND_AK4524,
@ -387,7 +387,7 @@ static const struct snd_ak4xxx_private akm_ewx2496_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_6fire = {
static const struct snd_akm4xxx akm_6fire = {
.num_adcs = 6,
.num_dacs = 6,
.type = SND_AK4524,

View File

@ -269,7 +269,7 @@ static void stdsp24_ak4524_lock(struct snd_akm4xxx *ak, int chip)
static int snd_ice1712_value_init(struct snd_ice1712 *ice)
{
/* Hoontech STDSP24 with modified hardware */
static struct snd_akm4xxx akm_stdsp24_mv = {
static const struct snd_akm4xxx akm_stdsp24_mv = {
.num_adcs = 2,
.num_dacs = 2,
.type = SND_AK4524,

View File

@ -282,7 +282,7 @@ static const struct snd_akm4xxx_dac_channel juli_dac[] = {
};
static struct snd_akm4xxx akm_juli_dac = {
static const struct snd_akm4xxx akm_juli_dac = {
.type = SND_AK4358,
.num_dacs = 8, /* DAC1 - analog out
DAC2 - analog in monitor

View File

@ -102,7 +102,7 @@ static const unsigned char wm_vol[256] = {
#define WM_VOL_MAX (sizeof(wm_vol) - 1)
#define WM_VOL_MUTE 0x8000
static struct snd_akm4xxx akm_phase22 = {
static const struct snd_akm4xxx akm_phase22 = {
.type = SND_AK4524,
.num_dacs = 2,
.num_adcs = 2,

View File

@ -386,7 +386,7 @@ static const struct snd_akm4xxx_adc_channel qtet_adc[] = {
AK_CONTROL(PCM_34_CAPTURE_VOLUME, 2),
};
static struct snd_akm4xxx akm_qtet_dac = {
static const struct snd_akm4xxx akm_qtet_dac = {
.type = SND_AK4620,
.num_dacs = 4, /* DAC1 - Output 12
*/

View File

@ -235,7 +235,7 @@ static const struct snd_akm4xxx_adc_channel revo51_adc[] = {
},
};
static struct snd_akm4xxx akm_revo_front = {
static const struct snd_akm4xxx akm_revo_front = {
.type = SND_AK4381,
.num_dacs = 2,
.ops = {
@ -256,7 +256,7 @@ static const struct snd_ak4xxx_private akm_revo_front_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_revo_surround = {
static const struct snd_akm4xxx akm_revo_surround = {
.type = SND_AK4355,
.idx_offset = 1,
.num_dacs = 6,
@ -278,7 +278,7 @@ static const struct snd_ak4xxx_private akm_revo_surround_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_revo51 = {
static const struct snd_akm4xxx akm_revo51 = {
.type = SND_AK4358,
.num_dacs = 8,
.ops = {
@ -299,7 +299,7 @@ static const struct snd_ak4xxx_private akm_revo51_priv = {
.mask_flags = 0,
};
static struct snd_akm4xxx akm_revo51_adc = {
static const struct snd_akm4xxx akm_revo51_adc = {
.type = SND_AK5365,
.num_adcs = 2,
.adc_info = revo51_adc,
@ -346,7 +346,7 @@ static const struct snd_akm4xxx_dac_channel ap192_dac[] = {
AK_DAC("PCM Playback Volume", 2)
};
static struct snd_akm4xxx akm_ap192 = {
static const struct snd_akm4xxx akm_ap192 = {
.type = SND_AK4358,
.num_dacs = 2,
.ops = {