Skip to content

Commit

Permalink
ALSA: pci: Constify snd_ac97_bus_ops definitions
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 3, 2020
1 parent 6e6598d commit 51055da
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion sound/pci/ad1889.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/atiixp_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/au88x0/au88x0_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/azt3328.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ca0106/ca0106_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs46xx/cs46xx_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs5535audio/cs5535audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/emu10k1/emu10k1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/emu10k1/emumixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ens1370.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/es1968.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
6 changes: 3 additions & 3 deletions sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/intel8x0m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/nm256/nm256.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/riptide/riptide.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/sis7019.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/trident/trident_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/via82xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/via82xx_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ymfpci/ymfpci_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 51055da

Please sign in to comment.