ALSA: pci: Constify snd_ac97_bus_ops definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:43 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:24:13 +0000 (09:24 +0100)
Now snd_ac97_bus() takes the const ops pointer, so we can define the
snd_ac97_bus_ops locally as const as well for further optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-28-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
28 files changed:
sound/pci/ad1889.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/au88x0/au88x0_mixer.c
sound/pci/azt3328.c
sound/pci/ca0106/ca0106_main.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs5535audio/cs5535audio.c
sound/pci/emu10k1/emu10k1x.c
sound/pci/emu10k1/emumixer.c
sound/pci/ens1370.c
sound/pci/es1968.c
sound/pci/fm801.c
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1724.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/maestro3.c
sound/pci/nm256/nm256.c
sound/pci/riptide/riptide.c
sound/pci/sis7019.c
sound/pci/trident/trident_main.c
sound/pci/via82xx.c
sound/pci/via82xx_modem.c
sound/pci/ymfpci/ymfpci_main.c

index 3daa978263f6b09dd61560e0d2f8ec286478d97c..5d42c42491bf190582a908fc408e63b66597df44 100644 (file)
@@ -760,7 +760,7 @@ snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override)
 {
        int err;
        struct snd_ac97_template ac97;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_ad1889_ac97_write,
                .read = snd_ad1889_ac97_read,
        };
index 39c33a944e5d19ead488089caa9dfc6fc3cac9aa..b2374266c52cadc156c5accb7cd12a1fba8c84e1 100644 (file)
@@ -1791,7 +1791,7 @@ static int snd_ali_mixer(struct snd_ali *codec)
        struct snd_ac97_template ac97;
        unsigned int idx;
        int i, err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_ali_codec_write,
                .read = snd_ali_codec_read,
        };
index 64d978307755751f75d0cd93193d82178797060c..8d2471ea090bf98cb4dfcbae8f618358de735bac 100644 (file)
@@ -294,7 +294,7 @@ static int snd_als300_ac97(struct snd_als300 *chip)
        struct snd_ac97_bus *bus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_als300_ac97_write,
                .read = snd_als300_ac97_read,
        };
index 61ae4fe8d646b47828ca7b5602d035015dfc9916..c3281fab365dff2bdd562302fbcc0284995cc481 100644 (file)
@@ -1403,7 +1403,7 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock,
        struct snd_ac97_template ac97;
        int i, err;
        int codec_count;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_atiixp_ac97_write,
                .read = snd_atiixp_ac97_read,
        };
index b62cde3a00b2611de6d1559ae36a8cd739213512..3ec34e78ffefe893b5575b93a29c2344eba698f7 100644 (file)
@@ -1046,7 +1046,7 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
        struct snd_ac97_template ac97;
        int i, err;
        int codec_count;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_atiixp_ac97_write,
                .read = snd_atiixp_ac97_read,
        };
index 60dd8a091bc39fdd7d4090344f0205f609612ab6..5b647682b683b89fcafb89616220982858beca22 100644 (file)
@@ -25,7 +25,7 @@ static int snd_vortex_mixer(vortex_t *vortex)
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = vortex_codec_write,
                .read = vortex_codec_read,
        };
index 810d5772f0976461f230a060d3cb8c27797b63fe..898ba55fc0ddef3dcaa80c0c2d09ffcd7e0eea25 100644 (file)
@@ -757,7 +757,7 @@ snd_azf3328_mixer_new(struct snd_azf3328 *chip)
 {
        struct snd_ac97_bus *bus;
        struct snd_ac97_template ac97;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_azf3328_mixer_ac97_write,
                .read = snd_azf3328_mixer_ac97_read,
        };
index e65154cecad558420c3b4c8be0768c0c552e9218..d3bd27ddb049c0a5af6ae74115a929221d6ffe5b 100644 (file)
@@ -1161,7 +1161,7 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip)
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_ca0106_ac97_write,
                .read = snd_ca0106_ac97_read,
        };
index 75450e329ceef38017360ce0057e85fb18fb9352..8fd64dab372d263d53bed3ec21daf7179b2b5735 100644 (file)
@@ -1064,7 +1064,7 @@ static int snd_cs4281_mixer(struct cs4281 *chip)
        struct snd_card *card = chip->card;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_cs4281_ac97_write,
                .read = snd_cs4281_ac97_read,
        };
index 6251fa8da939517db7f1d6f77aef194a2634f475..3f2fe26efee396bdf606f0554b08c68d5d529b1f 100644 (file)
@@ -2465,7 +2465,7 @@ int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
        struct snd_ctl_elem_id id;
        int err;
        unsigned int idx;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
                .reset = snd_cs46xx_codec_reset,
 #endif
index 930c2ac405e556716726c0df2309e0364102ed56..11ce3c4589faf52445287a19c742e3578412b165 100644 (file)
@@ -138,7 +138,7 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_cs5535audio_ac97_codec_write,
                .read = snd_cs5535audio_ac97_codec_read,
        };
index 90ae1c72d663b958479002a274245bf01d5df6df..ddb7c2ce3f7c909de568ade69bd7a3d95becd6b9 100644 (file)
@@ -718,7 +718,7 @@ static int snd_emu10k1x_ac97(struct emu10k1x *chip)
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_emu10k1x_ac97_write,
                .read = snd_emu10k1x_ac97_read,
        };
index 7c0417253cb5c3f5d8ea28199058d6398fee3986..0b3dfc71fa69dd1c87ccf83c023ea384659050ac 100644 (file)
@@ -1898,7 +1898,7 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
        if (emu->card_capabilities->ac97_chip) {
                struct snd_ac97_bus *pbus;
                struct snd_ac97_template ac97;
-               static struct snd_ac97_bus_ops ops = {
+               static const struct snd_ac97_bus_ops ops = {
                        .write = snd_emu10k1_ac97_write,
                        .read = snd_emu10k1_ac97_read,
                };
index 7611e44e2af591728c27244c25ed2273543eed3e..15e6d2377ecfca7652e1200e653a3d46e4475511 100644 (file)
@@ -1596,7 +1596,7 @@ static int snd_ensoniq_1371_mixer(struct ensoniq *ensoniq,
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_es1371_codec_write,
                .read = snd_es1371_codec_read,
                .wait = snd_es1371_codec_wait,
index 43cfdf02048bb34b4c3bcb188c562c4552aa1996..f23a935267c37ab2029d0e0ad8cba78feaf6d113 100644 (file)
@@ -2007,7 +2007,7 @@ snd_es1968_mixer(struct es1968 *chip)
        struct snd_ctl_elem_id elem_id;
 #endif
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_es1968_ac97_write,
                .read = snd_es1968_ac97_read,
        };
index bb5cffee5dacd8b34c5de4e2b745fdae4ddd8961..ae2b413ff489e621adb0f75f96fcea8b49033572 100644 (file)
@@ -1020,7 +1020,7 @@ static int snd_fm801_mixer(struct fm801 *chip)
        struct snd_ac97_template ac97;
        unsigned int i;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_fm801_codec_write,
                .read = snd_fm801_codec_read,
        };
index 15cb90dceeb83de6267fdce1f20d4240ca022a80..9794bbedffc32839d74dd532a3b2907a4a85ed72 100644 (file)
@@ -1464,11 +1464,11 @@ static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice)
        int err, bus_num = 0;
        struct snd_ac97_template ac97;
        struct snd_ac97_bus *pbus;
-       static struct snd_ac97_bus_ops con_ops = {
+       static const struct snd_ac97_bus_ops con_ops = {
                .write = snd_ice1712_ac97_write,
                .read = snd_ice1712_ac97_read,
        };
-       static struct snd_ac97_bus_ops pro_ops = {
+       static const struct snd_ac97_bus_ops pro_ops = {
                .write = snd_ice1712_pro_ac97_write,
                .read = snd_ice1712_pro_ac97_read,
        };
index 628b0581a4fff53f02aca2eb6fbe5a9139c289e1..4630a8c42aa909789f88acb7eb864731777ac638 100644 (file)
@@ -1463,7 +1463,7 @@ static int snd_vt1724_ac97_mixer(struct snd_ice1712 *ice)
        if (!(ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S)) {
                struct snd_ac97_bus *pbus;
                struct snd_ac97_template ac97;
-               static struct snd_ac97_bus_ops ops = {
+               static const struct snd_ac97_bus_ops ops = {
                        .write = snd_vt1724_ac97_write,
                        .read = snd_vt1724_ac97_read,
                };
index 563f3a3e820ee297d1b5c646e693241634f66f88..de875ea8ecbe2ed3f94ea6816a3b3725a75c3f19 100644 (file)
@@ -2138,12 +2138,12 @@ static int snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
        int err;
        unsigned int i, codecs;
        unsigned int glob_sta = 0;
-       struct snd_ac97_bus_ops *ops;
-       static struct snd_ac97_bus_ops standard_bus_ops = {
+       const struct snd_ac97_bus_ops *ops;
+       static const struct snd_ac97_bus_ops standard_bus_ops = {
                .write = snd_intel8x0_codec_write,
                .read = snd_intel8x0_codec_read,
        };
-       static struct snd_ac97_bus_ops ali_bus_ops = {
+       static const struct snd_ac97_bus_ops ali_bus_ops = {
                .write = snd_intel8x0_ali_codec_write,
                .read = snd_intel8x0_ali_codec_read,
        };
index c6dc36167a0178d65d7ccb122837d49d2f5d4070..74d45b9a1571cc32faac2f3b69aaff49961927df 100644 (file)
@@ -801,7 +801,7 @@ static int snd_intel8x0m_mixer(struct intel8x0m *chip, int ac97_clock)
        struct snd_ac97 *x97;
        int err;
        unsigned int glob_sta = 0;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_intel8x0m_codec_write,
                .read = snd_intel8x0m_codec_read,
        };
index b94e3ec5f1587e573f567ea68615f212cba78aca..89018d44d77714c3c7b10a2cdda30af8b15b0f9e 100644 (file)
@@ -2036,7 +2036,7 @@ static int snd_m3_mixer(struct snd_m3 *chip)
        struct snd_ctl_elem_id elem_id;
 #endif
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_m3_ac97_write,
                .read = snd_m3_ac97_read,
        };
index 003a09788572085e7423a28139951156c53bdf34..99228b93b3c61714e24fb1f2926659e1fdbbae88 100644 (file)
@@ -1309,7 +1309,7 @@ snd_nm256_mixer(struct nm256 *chip)
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .reset = snd_nm256_ac97_reset,
                .write = snd_nm256_ac97_write,
                .read = snd_nm256_ac97_read,
index 6617bc347bfb4991ba518045b5ca37c1e9a0ad2a..625c854289550668bbafb176ae2a92fbde3532ab 100644 (file)
@@ -1963,7 +1963,7 @@ static int snd_riptide_mixer(struct snd_riptide *chip)
        struct snd_ac97_bus *pbus;
        struct snd_ac97_template ac97;
        int err = 0;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_riptide_codec_write,
                .read = snd_riptide_codec_read,
        };
index 2e351bf1d79264c749cd4f17c60c5c72cfaf3965..4977ab0b8b3d301b9d3bf215cf62c7a754ba2f8e 100644 (file)
@@ -983,7 +983,7 @@ static int sis_mixer_create(struct sis7019 *sis)
 {
        struct snd_ac97_bus *bus;
        struct snd_ac97_template ac97;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = sis_ac97_write,
                .read = sis_ac97_read,
        };
index ba4a9fcd5eba22b4ddb03e7ade3be688849a2522..6e50376163a220db166ddbe5e100f8535a840ba8 100644 (file)
@@ -2912,7 +2912,7 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device)
        struct snd_kcontrol *kctl;
        struct snd_ctl_elem_value *uctl;
        int idx, err, retries = 2;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_trident_codec_write,
                .read = snd_trident_codec_read,
        };
index 090b0c47fbdd329389b1d3dbe41d0bb34bb88408..c8fb51885b6d25b65e0c295e7a8352fb79df2176 100644 (file)
@@ -1868,7 +1868,7 @@ static int snd_via82xx_mixer_new(struct via82xx *chip, const char *quirk_overrid
 {
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_via82xx_codec_write,
                .read = snd_via82xx_codec_read,
                .wait = snd_via82xx_codec_wait,
index 7f138fa4e141e78e95984f0a336061af62f2b534..84e589803e2e7a93966dccb53057ca1a23a163b0 100644 (file)
@@ -871,7 +871,7 @@ static int snd_via82xx_mixer_new(struct via82xx_modem *chip)
 {
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_via82xx_codec_write,
                .read = snd_via82xx_codec_read,
                .wait = snd_via82xx_codec_wait,
index 1d9295bb00a9f9375091c610621abcc803131867..a531f4d2605db52c870c268767856caf971535d2 100644 (file)
@@ -1780,7 +1780,7 @@ int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch)
        struct snd_pcm_substream *substream;
        unsigned int idx;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_ymfpci_codec_write,
                .read = snd_ymfpci_codec_read,
        };