ALSA: ice1712: add const to snd_ak4xxx_private structures
authorBhumika Goyal <bhumirks@gmail.com>
Fri, 4 Aug 2017 15:34:41 +0000 (21:04 +0530)
committerTakashi Iwai <tiwai@suse.de>
Sun, 6 Aug 2017 20:16:37 +0000 (22:16 +0200)
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 <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ice1712/delta.c
sound/pci/ice1712/ews.c
sound/pci/ice1712/hoontech.c
sound/pci/ice1712/phase.c
sound/pci/ice1712/revo.c

index da5f37b7fdd0d6f2932d12c9f2baaf379331b52d..4e470f09e2157bd2f8f3d10f875254e618a7b8db 100644 (file)
@@ -454,7 +454,7 @@ static struct snd_akm4xxx akm_audiophile = {
        }
 };
 
-static struct snd_ak4xxx_private akm_audiophile_priv = {
+static const struct snd_ak4xxx_private akm_audiophile_priv = {
        .caddr = 2,
        .cif = 0,
        .data_mask = ICE1712_DELTA_AP_DOUT,
@@ -475,7 +475,7 @@ static struct snd_akm4xxx akm_delta410 = {
        }
 };
 
-static struct snd_ak4xxx_private akm_delta410_priv = {
+static const struct snd_ak4xxx_private akm_delta410_priv = {
        .caddr = 0,
        .cif = 0,
        .data_mask = ICE1712_DELTA_AP_DOUT,
@@ -497,7 +497,7 @@ static struct snd_akm4xxx akm_delta1010lt = {
        }
 };
 
-static struct snd_ak4xxx_private akm_delta1010lt_priv = {
+static const struct snd_ak4xxx_private akm_delta1010lt_priv = {
        .caddr = 2,
        .cif = 0, /* the default level of the CIF pin from AK4524 */
        .data_mask = ICE1712_DELTA_1010LT_DOUT,
@@ -519,7 +519,7 @@ static struct snd_akm4xxx akm_delta66e = {
        }
 };
 
-static struct snd_ak4xxx_private akm_delta66e_priv = {
+static const struct snd_ak4xxx_private akm_delta66e_priv = {
        .caddr = 2,
        .cif = 0, /* the default level of the CIF pin from AK4524 */
        .data_mask = ICE1712_DELTA_66E_DOUT,
@@ -542,7 +542,7 @@ static struct snd_akm4xxx akm_delta44 = {
        }
 };
 
-static struct snd_ak4xxx_private akm_delta44_priv = {
+static const struct snd_ak4xxx_private akm_delta44_priv = {
        .caddr = 2,
        .cif = 0, /* the default level of the CIF pin from AK4524 */
        .data_mask = ICE1712_DELTA_CODEC_SERIAL_DATA,
@@ -564,7 +564,7 @@ static struct snd_akm4xxx akm_vx442 = {
        }
 };
 
-static struct snd_ak4xxx_private akm_vx442_priv = {
+static const struct snd_ak4xxx_private akm_vx442_priv = {
        .caddr = 2,
        .cif = 0,
        .data_mask = ICE1712_VX442_DOUT,
index ec07136fc288ca349fa2ab18eac27e3a7e7451eb..5bc14e8806a7d4382860cd01d4d299fe5239a4ca 100644 (file)
@@ -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,
index a40001c1d9e8b3ee543c3323e5639cd1fbeb4192..de2fcc9a983e7f15718a1d7432292cd48f384db5 100644 (file)
@@ -278,7 +278,7 @@ static int snd_ice1712_value_init(struct snd_ice1712 *ice)
                }
        };
 
-       static struct snd_ak4xxx_private akm_stdsp24_mv_priv = {
+       static const struct snd_ak4xxx_private akm_stdsp24_mv_priv = {
                .caddr = 2,
                .cif = 1, /* CIF high */
                .data_mask = ICE1712_STDSP24_SERIAL_DATA,
index e9ca89c9174bbe7124ccd7dbaeb76301ebb11cfc..4f85482f3407dbdd0b98a57ddce5e879811e72d6 100644 (file)
@@ -108,7 +108,7 @@ static struct snd_akm4xxx akm_phase22 = {
        .num_adcs = 2,
 };
 
-static struct snd_ak4xxx_private akm_phase22_priv = {
+static const struct snd_ak4xxx_private akm_phase22_priv = {
        .caddr =        2,
        .cif =          1,
        .data_mask =    1 << 4,
index 1d81ae67757328df9764162b0b92495158ccf89e..5cc4213fcad092455e0439ad417aa69a2da98f78 100644 (file)
@@ -244,7 +244,7 @@ static struct snd_akm4xxx akm_revo_front = {
        .dac_info = revo71_front,
 };
 
-static struct snd_ak4xxx_private akm_revo_front_priv = {
+static const struct snd_ak4xxx_private akm_revo_front_priv = {
        .caddr = 1,
        .cif = 0,
        .data_mask = VT1724_REVO_CDOUT,
@@ -266,7 +266,7 @@ static struct snd_akm4xxx akm_revo_surround = {
        .dac_info = revo71_surround,
 };
 
-static struct snd_ak4xxx_private akm_revo_surround_priv = {
+static const struct snd_ak4xxx_private akm_revo_surround_priv = {
        .caddr = 3,
        .cif = 0,
        .data_mask = VT1724_REVO_CDOUT,
@@ -287,7 +287,7 @@ static struct snd_akm4xxx akm_revo51 = {
        .dac_info = revo51_dac,
 };
 
-static struct snd_ak4xxx_private akm_revo51_priv = {
+static const struct snd_ak4xxx_private akm_revo51_priv = {
        .caddr = 2,
        .cif = 0,
        .data_mask = VT1724_REVO_CDOUT,
@@ -305,7 +305,7 @@ static struct snd_akm4xxx akm_revo51_adc = {
        .adc_info = revo51_adc,
 };
 
-static struct snd_ak4xxx_private akm_revo51_adc_priv = {
+static const struct snd_ak4xxx_private akm_revo51_adc_priv = {
        .caddr = 2,
        .cif = 0,
        .data_mask = VT1724_REVO_CDOUT,
@@ -355,7 +355,7 @@ static struct snd_akm4xxx akm_ap192 = {
        .dac_info = ap192_dac,
 };
 
-static struct snd_ak4xxx_private akm_ap192_priv = {
+static const struct snd_ak4xxx_private akm_ap192_priv = {
        .caddr = 2,
        .cif = 0,
        .data_mask = VT1724_REVO_CDOUT,