From 4647e8d512224265afad63aa27a6b22561f50d46 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Fri, 4 Aug 2017 21:04:41 +0530 Subject: ALSA: ice1712: add const to snd_ak4xxx_private structures Declare snd_ak4xxx_private 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_ak4xxx_private 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_ak4xxx_private s={...}; Signed-off-by: Bhumika Goyal Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ews.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/pci/ice1712/ews.c') diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index ec07136fc288..5bc14e8806a7 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c @@ -354,7 +354,7 @@ static struct snd_akm4xxx akm_ews88mt = { } }; -static struct snd_ak4xxx_private akm_ews88mt_priv = { +static const struct snd_ak4xxx_private akm_ews88mt_priv = { .caddr = 2, .cif = 1, /* CIF high */ .data_mask = ICE1712_EWS88_SERIAL_DATA, @@ -375,7 +375,7 @@ static struct snd_akm4xxx akm_ewx2496 = { } }; -static struct snd_ak4xxx_private akm_ewx2496_priv = { +static const struct snd_ak4xxx_private akm_ewx2496_priv = { .caddr = 2, .cif = 1, /* CIF high */ .data_mask = ICE1712_EWS88_SERIAL_DATA, @@ -396,7 +396,7 @@ static struct snd_akm4xxx akm_6fire = { } }; -static struct snd_ak4xxx_private akm_6fire_priv = { +static const struct snd_ak4xxx_private akm_6fire_priv = { .caddr = 2, .cif = 1, /* CIF high */ .data_mask = ICE1712_6FIRE_SERIAL_DATA, -- cgit From 3135432e429ef9b69f75ad06e81071e648753a26 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Fri, 4 Aug 2017 23:19:30 +0530 Subject: 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 Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ews.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sound/pci/ice1712/ews.c') diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index 5bc14e8806a7..b8af747ecb43 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c @@ -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, -- cgit