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 3daa978..5d42c42 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 39c33a9..b237426 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 64d9783..8d2471e 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 61ae4fe..c3281fa 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 b62cde3..3ec34e7 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 60dd8a0..5b64768 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 810d577..898ba55 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 e65154c..d3bd27d 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 75450e3..8fd64da 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 6251fa8..3f2fe26 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 930c2ac..11ce3c4 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 90ae1c7..ddb7c2c 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 7c04172..0b3dfc7 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 7611e44..15e6d23 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 43cfdf0..f23a935 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 bb5cffe..ae2b413 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 15cb90d..9794bbe 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 628b058..4630a8c 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 563f3a3..de875ea 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 c6dc361..74d45b9 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 b94e3ec..89018d4 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 003a097..99228b9 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 6617bc3..625c854 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 2e351bf..4977ab0 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 ba4a9fc..6e50376 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 090b0c4..c8fb518 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 7f138fa..84e5898 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 1d9295b..a531f4d 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,
        };