ALSA: Constifications
Subsystems (16)
cover ALSA: Constifications
Hi,
inspired by the recent fixes for constification, I took a look at the whole tree and found that there are still a lot of remaining low hanging fruits. So here is the result -- const prefix is added where possible and where necessary.
BTW, I haven't touched ASoC code as they are way too hot to play with at this time. They have different code patterns, so most of these conversions don't apply in anyway, but there must be some other missing gems, so if anyone wants, just go digging there.
thanks,
Takashi
===
Takashi Iwai (58):
ALSA: pci: Constify snd_pcm_hardware definitions
ALSA: usb: Constify snd_pcm_hardware definitions
ALSA: core: Treat snd_device_ops as const
ALSA: core: Constify snd_device_ops definitions
ALSA: drivers: Constify snd_device_ops definitions
ALSA: i2c: Constify snd_device_ops definitions
ALSA: isa: Constify snd_device_ops definitions
ALSA: hda: Constify snd_device_ops definitions
ALSA: pci: Constify snd_device_ops definitions
ALSA: usb: Constify snd_device_ops definitions
ALSA: aoa: Constify snd_device_ops definitions
ALSA: mips: Constify snd_device_ops definitions
ALSA: parisc: Constify snd_device_ops definitions
ALSA: pcmcia: Constify snd_device_ops definitions
ALSA: ppc: Constify snd_device_ops definitions
ALSA: sparc: Constify snd_device_ops definitions
ALSA: sh: Constify snd_device_ops definitions
ALSA: spi: Constify snd_device_ops definitions
ALSA: docs: Constify snd_device_ops definitions
ALSA: timer: Constify snd_timer_hardware definitions
ALSA: Constify snd_timer_hardware definitions
ALSA: ac97: Treat snd_ac97_bus_ops as const
ALSA: ac97: Constify snd_ac97_bus_ops definitions
ALSA: arm: Constify snd_ac97_bus_ops definitions
ALSA: atmel: Constify snd_ac97_bus_ops definitions
ALSA: drivers: Constify snd_ac97_bus_ops definitions
ALSA: pci: Constify snd_ac97_bus_ops definitions
ALSA: info: Make snd_info_entry_ops as const
ALSA: seq: Constify struct snd_midi_op
ALSA: vx: Constify snd_vx_hardware and snd_vx_ops definitions
ALSA: mixer: oss: Constify snd_mixer_oss_assign_table definition
ALSA: aoa: Constify snd_kcontrol_new items
ALSA: drivers: Constify snd_kcontrol_new items
ALSA: i2c: Constify snd_kcontrol_new items
ALSA: isa: Constify snd_kcontrol_new items
ALSA: hda: Constify snd_kcontrol_new items
ALSA: pci: Constify snd_kcontrol_new items
ALSA: ppc: Constify snd_kcontrol_new items
ALSA: sparc: Constify snd_kcontrol_new items
ALSA: spi: Constify snd_kcontrol_new items
ALSA: usb: Constify snd_kcontrol_new items
ALSA: parisc: Constify snd_kcontrol_new items
ALSA: dummy: Constify snd_pcm_ops definitions
ALSA: opl3: Constify snd_opl3_drum_voice definitions
ALSA: ac97: Constify snd_ac97_res_table definition
ALSA: ca0106: Constify snd_ca0106_category_str items
ALSA: ca0106: Constify snd_ca0106_details
ALSA: ice17xx: Constify snd_ice1712_card_info
ALSA: ice1712: Constify wm-specific tables
ALSA: line6: Constify snd_ratden definitions
ALSA: usx2y: Constify struct snd_usb_audio_quirk entries
ALSA: seq: oss: Constify snd_seq_oss_callback definitions
ALSA: bt87x: Constify snd_bt87x_boards
ALSA: emu10k1: Constify snd_emu_chip_details
ALSA: es1968: Constify snd_es1968_tea575x_gpios
ALSA: fm801: Constify snd_fm801_tea575x_gpios
ALSA: hda: Constify snd_pci_quirk tables
ALSA: pci: Constify snd_pci_quirk tables
.../sound/kernel-api/writing-an-alsa-driver.rst | 8 ++-- include/sound/ac97_codec.h | 5 ++- include/sound/core.h | 4 +- include/sound/info.h | 2 +- include/sound/seq_midi_emul.h | 3 +- include/sound/vx_core.h | 9 ++-- sound/ac97/snd_ac97_compat.c | 2 +- sound/ac97_bus.c | 2 +- sound/aoa/aoa.h | 2 +- sound/aoa/codecs/onyx.c | 4 +- sound/aoa/codecs/tas.c | 4 +- sound/aoa/codecs/toonie.c | 2 +- sound/aoa/core/alsa.c | 2 +- sound/aoa/fabrics/layout.c | 2 +- sound/arm/aaci.c | 2 +- sound/arm/pxa2xx-ac97.c | 2 +- sound/atmel/ac97c.c | 2 +- sound/core/compress_offload.c | 2 +- sound/core/control.c | 2 +- sound/core/device.c | 2 +- sound/core/hwdep.c | 2 +- sound/core/jack.c | 2 +- sound/core/oss/mixer_oss.c | 14 +++--- sound/core/pcm.c | 4 +- sound/core/pcm_timer.c | 2 +- sound/core/rawmidi.c | 2 +- sound/core/seq/seq_midi_emul.c | 37 +++++++++------- sound/core/seq_device.c | 2 +- sound/core/timer.c | 4 +- sound/drivers/aloop.c | 2 +- sound/drivers/dummy.c | 8 ++-- sound/drivers/ml403-ac97cr.c | 4 +- sound/drivers/mts64.c | 14 +++--- sound/drivers/opl3/opl3_drums.c | 26 +++++------ sound/drivers/opl3/opl3_lib.c | 6 +-- sound/drivers/opl3/opl3_oss.c | 2 +- sound/drivers/opl3/opl3_seq.c | 2 +- sound/drivers/opl3/opl3_voice.h | 2 +- sound/drivers/opl4/opl4_lib.c | 2 +- sound/drivers/opl4/opl4_mixer.c | 2 +- sound/drivers/opl4/opl4_proc.c | 2 +- sound/drivers/opl4/opl4_seq.c | 2 +- sound/drivers/pcsp/pcsp.c | 2 +- sound/drivers/pcsp/pcsp_mixer.c | 6 +-- sound/drivers/serial-u16550.c | 2 +- sound/drivers/vx/vx_core.c | 5 ++- sound/i2c/cs8427.c | 2 +- sound/i2c/i2c.c | 2 +- sound/i2c/other/ak4113.c | 4 +- sound/i2c/other/ak4114.c | 4 +- sound/i2c/other/ak4117.c | 4 +- sound/i2c/tea6330t.c | 4 +- sound/isa/ad1816a/ad1816a_lib.c | 4 +- sound/isa/cmi8330.c | 2 +- sound/isa/cs423x/cs4236_lib.c | 14 +++--- sound/isa/es1688/es1688_lib.c | 4 +- sound/isa/es18xx.c | 28 ++++++------ sound/isa/gus/gus_main.c | 2 +- sound/isa/gus/gus_mem_proc.c | 2 +- sound/isa/gus/gus_mixer.c | 4 +- sound/isa/gus/gus_timer.c | 4 +- sound/isa/msnd/msnd_pinnacle.c | 2 +- sound/isa/msnd/msnd_pinnacle_mixer.c | 2 +- sound/isa/opl3sa2.c | 4 +- sound/isa/opti9xx/miro.c | 14 +++--- sound/isa/opti9xx/opti92x-ad1848.c | 2 +- sound/isa/sb/emu8000.c | 16 +++---- sound/isa/sb/sb_common.c | 2 +- sound/isa/sb/sb_mixer.c | 2 +- sound/isa/wss/wss_lib.c | 6 +-- sound/mips/hal2.c | 2 +- sound/mips/sgio2audio.c | 2 +- sound/parisc/harmony.c | 4 +- sound/pci/ac97/ac97_codec.c | 7 +-- sound/pci/ac97/ac97_patch.c | 2 +- sound/pci/ad1889.c | 4 +- sound/pci/ak4531_codec.c | 4 +- sound/pci/ali5451/ali5451.c | 14 +++--- sound/pci/als300.c | 4 +- sound/pci/atiixp.c | 6 +-- sound/pci/atiixp_modem.c | 4 +- sound/pci/au88x0/au88x0.c | 2 +- sound/pci/au88x0/au88x0_mixer.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 2 +- sound/pci/aw2/aw2-alsa.c | 2 +- sound/pci/azt3328.c | 6 +-- sound/pci/bt87x.c | 4 +- sound/pci/ca0106/ca0106.h | 2 +- sound/pci/ca0106/ca0106_main.c | 10 ++--- sound/pci/ca0106/ca0106_mixer.c | 6 +-- sound/pci/ca0106/ca0106_proc.c | 2 +- sound/pci/cmipci.c | 18 ++++---- sound/pci/cs4281.c | 8 ++-- sound/pci/cs46xx/cs46xx_lib.c | 10 ++--- sound/pci/cs5530.c | 2 +- sound/pci/cs5535audio/cs5535audio.c | 4 +- sound/pci/cs5535audio/cs5535audio_olpc.c | 2 +- sound/pci/ctxfi/ctatc.c | 6 +-- sound/pci/echoaudio/darla20.c | 2 +- sound/pci/echoaudio/darla24.c | 2 +- sound/pci/echoaudio/echo3g.c | 2 +- sound/pci/echoaudio/echoaudio.c | 2 +- sound/pci/echoaudio/gina20.c | 2 +- sound/pci/echoaudio/gina24.c | 2 +- sound/pci/echoaudio/indigo.c | 2 +- sound/pci/echoaudio/indigodj.c | 2 +- sound/pci/echoaudio/indigodjx.c | 2 +- sound/pci/echoaudio/indigoio.c | 2 +- sound/pci/echoaudio/indigoiox.c | 2 +- sound/pci/echoaudio/layla20.c | 2 +- sound/pci/echoaudio/layla24.c | 2 +- sound/pci/echoaudio/mia.c | 2 +- sound/pci/echoaudio/mona.c | 2 +- sound/pci/emu10k1/emu10k1_main.c | 4 +- sound/pci/emu10k1/emu10k1x.c | 4 +- sound/pci/emu10k1/emumixer.c | 16 +++---- sound/pci/emu10k1/emuproc.c | 2 +- sound/pci/emu10k1/p16v.c | 2 +- sound/pci/emu10k1/timer.c | 2 +- sound/pci/ens1370.c | 16 +++---- sound/pci/es1938.c | 4 +- sound/pci/es1968.c | 6 +-- sound/pci/fm801.c | 10 ++--- sound/pci/hda/hda_beep.c | 2 +- sound/pci/hda/hda_codec.c | 10 ++--- sound/pci/hda/hda_intel.c | 10 ++--- sound/pci/hda/hda_tegra.c | 2 +- sound/pci/hda/patch_sigmatel.c | 6 +-- sound/pci/ice1712/aureon.c | 10 ++--- sound/pci/ice1712/delta.c | 10 ++--- sound/pci/ice1712/ews.c | 6 +-- sound/pci/ice1712/ice1712.c | 14 +++--- sound/pci/ice1712/ice1712.h | 2 +- sound/pci/ice1712/ice1724.c | 16 +++---- sound/pci/ice1712/juli.c | 2 +- sound/pci/ice1712/maya44.c | 2 +- sound/pci/ice1712/phase.c | 4 +- sound/pci/ice1712/pontis.c | 2 +- sound/pci/ice1712/prodigy192.c | 4 +- sound/pci/ice1712/prodigy_hifi.c | 4 +- sound/pci/ice1712/quartet.c | 2 +- sound/pci/ice1712/wm8766.c | 2 +- sound/pci/ice1712/wm8776.c | 2 +- sound/pci/ice1712/wtm.c | 2 +- sound/pci/intel8x0.c | 14 +++--- sound/pci/intel8x0m.c | 4 +- sound/pci/korg1212/korg1212.c | 4 +- sound/pci/lola/lola.c | 2 +- sound/pci/lx6464es/lx6464es.c | 2 +- sound/pci/maestro3.c | 12 +++--- sound/pci/mixart/mixart.c | 6 +-- sound/pci/nm256/nm256.c | 12 +++--- sound/pci/pcxhr/pcxhr.c | 2 +- sound/pci/riptide/riptide.c | 4 +- sound/pci/rme32.c | 2 +- sound/pci/rme96.c | 2 +- sound/pci/rme9652/hdsp.c | 8 ++-- sound/pci/rme9652/hdspm.c | 18 ++++---- sound/pci/rme9652/rme9652.c | 6 +-- sound/pci/sis7019.c | 4 +- sound/pci/sonicvibes.c | 8 ++-- sound/pci/trident/trident_main.c | 4 +- sound/pci/via82xx.c | 6 +-- sound/pci/via82xx_modem.c | 4 +- sound/pci/vx222/vx222.c | 14 +++--- sound/pci/vx222/vx222.h | 4 +- sound/pci/vx222/vx222_ops.c | 4 +- sound/pci/ymfpci/ymfpci_main.c | 8 ++-- sound/pcmcia/pdaudiocf/pdaudiocf.c | 2 +- sound/pcmcia/vx/vxp_ops.c | 2 +- sound/pcmcia/vx/vxpocket.c | 6 +-- sound/pcmcia/vx/vxpocket.h | 2 +- sound/ppc/awacs.c | 50 +++++++++++----------- sound/ppc/burgundy.c | 20 ++++----- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 4 +- sound/ppc/snd_ps3.c | 2 +- sound/ppc/tumbler.c | 4 +- sound/sh/sh_dac_audio.c | 2 +- sound/sparc/amd7930.c | 4 +- sound/sparc/cs4231.c | 8 ++-- sound/sparc/dbri.c | 2 +- sound/spi/at73c213.c | 4 +- sound/synth/emux/emux_oss.c | 2 +- sound/synth/emux/emux_seq.c | 2 +- sound/usb/6fire/control.c | 8 ++-- sound/usb/caiaq/audio.c | 2 +- sound/usb/line6/pod.c | 2 +- sound/usb/line6/podhd.c | 2 +- sound/usb/line6/toneport.c | 2 +- sound/usb/mixer.c | 8 ++-- sound/usb/mixer.h | 2 +- sound/usb/mixer_quirks.c | 16 +++---- sound/usb/mixer_us16x08.c | 38 ++++++++-------- sound/usb/mixer_us16x08.h | 2 +- sound/usb/usx2y/us122l.c | 8 ++-- sound/usb/usx2y/usX2Yhwdep.c | 10 ++--- sound/usb/usx2y/usbusx2yaudio.c | 2 +- sound/usb/usx2y/usx2yhwdeppcm.c | 2 +- 199 files changed, 548 insertions(+), 534 deletions(-)
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 1/58 ALSA: pci: Constify snd_pcm_hardware definitions
Most of snd_pcm_hardware definitions are just copied to another object as-is, hence we can define them as const for further optimization.
There should be no functional changes by this patch.
--- sound/pci/ali5451/ali5451.c | 8 ++++---- sound/pci/echoaudio/darla20.c | 2 +- sound/pci/echoaudio/darla24.c | 2 +- sound/pci/echoaudio/echo3g.c | 2 +- sound/pci/echoaudio/gina20.c | 2 +- sound/pci/echoaudio/gina24.c | 2 +- sound/pci/echoaudio/indigo.c | 2 +- sound/pci/echoaudio/indigodj.c | 2 +- sound/pci/echoaudio/indigodjx.c | 2 +- sound/pci/echoaudio/indigoio.c | 2 +- sound/pci/echoaudio/indigoiox.c | 2 +- sound/pci/echoaudio/layla20.c | 2 +- sound/pci/echoaudio/layla24.c | 2 +- sound/pci/echoaudio/mia.c | 2 +- sound/pci/echoaudio/mona.c | 2 +- sound/pci/nm256/nm256.c | 6 +++--- sound/pci/rme9652/hdspm.c | 4 ++-- 17 files changed, 23 insertions(+), 23 deletions(-)
sound/pci/ali5451/ali5451.c +4 -4
@@ -1400,7 +1400,7 @@ static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream)return cso; } -static struct snd_pcm_hardware snd_ali_playback = +static const struct snd_pcm_hardware snd_ali_playback = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1426,7 +1426,7 @@ static struct snd_pcm_hardware snd_ali_playback =* Capture support device description */ -static struct snd_pcm_hardware snd_ali_capture = +static const struct snd_pcm_hardware snd_ali_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -1457,7 +1457,7 @@ static void snd_ali_pcm_free_substream(struct snd_pcm_runtime *runtime) }static int snd_ali_open (struct snd_pcm_substream *substream,int rec, -int channel,struct snd_pcm_hardware *phw) +int channel,const struct snd_pcm_hardware *phw) {struct snd_ali *codec =snd_pcm_substream_chip (substream);struct snd_pcm_runtime *runtime = substream->runtime;
@@ -1537,7 +1537,7 @@ static int snd_ali_modem_hw_params(struct snd_pcm_substream *substream,return 0 ; } -static struct snd_pcm_hardware snd_ali_modem = +static const struct snd_pcm_hardware snd_ali_modem = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/darla20.c +1 -1
@@ -56,7 +56,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/darla24.c +1 -1
@@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/echo3g.c +1 -1
@@ -74,7 +74,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/gina20.c +1 -1
@@ -60,7 +60,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/gina24.c +1 -1
@@ -81,7 +81,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/indigo.c +1 -1
@@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/indigodj.c +1 -1
@@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/indigodjx.c +1 -1
@@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/indigoio.c +1 -1
@@ -62,7 +62,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/indigoiox.c +1 -1
@@ -62,7 +62,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/layla20.c +1 -1
@@ -70,7 +70,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/layla24.c +1 -1
@@ -80,7 +80,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/mia.c +1 -1
@@ -71,7 +71,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/echoaudio/mona.c +1 -1
@@ -90,7 +90,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/pci/nm256/nm256.c +3 -3
@@ -785,7 +785,7 @@ snd_nm256_capture_update(struct nm256 *chip)/* * hardware info */ -static struct snd_pcm_hardware snd_nm256_playback = +static const struct snd_pcm_hardware snd_nm256_playback = { .info =SNDRV_PCM_INFO_MMAP_IOMEM |SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED |
@@ -804,7 +804,7 @@ static struct snd_pcm_hardware snd_nm256_playback = .period_bytes_max = 128 * 1024, }; -static struct snd_pcm_hardware snd_nm256_capture = +static const struct snd_pcm_hardware snd_nm256_capture = { .info =SNDRV_PCM_INFO_MMAP_IOMEM |SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED |
@@ -838,7 +838,7 @@ static int snd_nm256_pcm_hw_params(struct snd_pcm_substream *substream,*/ static void snd_nm256_setup_stream (struct nm256 *chip,struct nm256_stream *s,struct snd_pcm_substream *substream, -struct snd_pcm_hardware *hw_ptr) +const struct snd_pcm_hardware *hw_ptr) {struct snd_pcm_runtime *runtime = substream->runtime;
sound/pci/rme9652/hdspm.c +2 -2
@@ -5820,7 +5820,7 @@ static int snd_hdspm_prepare(struct snd_pcm_substream *substream)return 0 ; } -static struct snd_pcm_hardware snd_hdspm_playback_subinfo = { +static const struct snd_pcm_hardware snd_hdspm_playback_subinfo = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_NONINTERLEAVED |
@@ -5845,7 +5845,7 @@ static struct snd_pcm_hardware snd_hdspm_playback_subinfo = { .fifo_size = 0 }; -static struct snd_pcm_hardware snd_hdspm_capture_subinfo = { +static const struct snd_pcm_hardware snd_hdspm_capture_subinfo = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_NONINTERLEAVED |
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/58 ALSA: usb: Constify snd_pcm_hardware definitions
In reply to Takashi IwaiMost of snd_pcm_hardware definitions are just copied to another object as-is, hence we can define them as const for further optimization.
There should be no functional changes by this patch.
--- sound/usb/caiaq/audio.c | 2 +- sound/usb/usx2y/usbusx2yaudio.c | 2 +- sound/usb/usx2y/usx2yhwdeppcm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/usb/caiaq/audio.c +1 -1
@@ -30,7 +30,7 @@#define MAKE_CHECKBYTE (cdev,stream,i) \ (stream << 1) | (~(i / (cdev->n_streams * BYTES_PER_SAMPLE_USB)) & 1) -static struct snd_pcm_hardware snd_usb_caiaq_pcm_hardware = { +static const struct snd_pcm_hardware snd_usb_caiaq_pcm_hardware = { .info = (SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_BLOCK_TRANSFER ), .formats =SNDRV_PCM_FMTBIT_S24_3BE ,
sound/usb/usx2y/usbusx2yaudio.c +1 -1
@@ -838,7 +838,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream)return err; } -static struct snd_pcm_hardware snd_usX2Y_2c = +static const struct snd_pcm_hardware snd_usX2Y_2c = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
sound/usb/usx2y/usx2yhwdeppcm.c +1 -1
@@ -528,7 +528,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream)return err; } -static struct snd_pcm_hardware snd_usX2Y_4c = +static const struct snd_pcm_hardware snd_usX2Y_4c = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 3/58 ALSA: core: Treat snd_device_ops as const
In reply to Takashi IwaiThis is a preliminary patch to allow const for snd_device_ops definitions in each driver's code. The ops reference is read-only, hence it can be declared as const for further optimization.
There should be no functional changes by this patch.
--- include/sound/core.h | 4 ++-- sound/core/device.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
include/sound/core.h +2 -2
@@ -69,7 +69,7 @@ struct snd_device {enum snd_device_state state;/* state of the device */ enum snd_device_type type;/* device type */ void *device_data;/* device structure */ -struct snd_device_ops *ops;/* operations */ +const struct snd_device_ops *ops;/* operations */ };#define snd_device (n) list_entry(n, struct snd_device, list)
@@ -256,7 +256,7 @@ static inline void snd_card_unref(struct snd_card *card)/* device.c */ int snd_device_new (struct snd_card *card,enum snd_device_type type, -void *device_data,struct snd_device_ops *ops); +void *device_data,const struct snd_device_ops *ops);int snd_device_register (struct snd_card *card,void *device_data);int snd_device_register_all (struct snd_card *card);void snd_device_disconnect (struct snd_card *card,void *device_data);
sound/core/device.c +1 -1
@@ -27,7 +27,7 @@* Return: Zero if successful, or a negative error code on failure. */ int snd_device_new (struct snd_card *card,enum snd_device_type type, -void *device_data,struct snd_device_ops *ops) +void *device_data,const struct snd_device_ops *ops) {struct snd_device *dev;struct list_head *p;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 4/58 ALSA: core: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/core/compress_offload.c | 2 +- sound/core/control.c | 2 +- sound/core/hwdep.c | 2 +- sound/core/jack.c | 2 +- sound/core/pcm.c | 4 ++-- sound/core/rawmidi.c | 2 +- sound/core/seq_device.c | 2 +- sound/core/timer.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-)
sound/core/compress_offload.c +1 -1
@@ -1099,7 +1099,7 @@ static int snd_compress_dev_free(struct snd_device *device)int snd_compress_new (struct snd_card *card,int device,int dirn,const char *id,struct snd_compr *compr) { -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_compress_dev_free, .dev_register = snd_compress_dev_register, .dev_disconnect = snd_compress_dev_disconnect,
sound/core/control.c +1 -1
@@ -1823,7 +1823,7 @@ static int snd_ctl_dev_free(struct snd_device *device)*/ int snd_ctl_create (struct snd_card *card) { -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ctl_dev_free, .dev_register = snd_ctl_dev_register, .dev_disconnect = snd_ctl_dev_disconnect,
sound/core/hwdep.c +1 -1
@@ -353,7 +353,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device, {struct snd_hwdep *hwdep;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_hwdep_dev_free, .dev_register = snd_hwdep_dev_register, .dev_disconnect = snd_hwdep_dev_disconnect,
sound/core/jack.c +1 -1
@@ -201,7 +201,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,struct snd_jack *jack;struct snd_jack_kctl *jack_kctl =NULL ;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_jack_dev_free, #ifdef CONFIG_SND_JACK_INPUT_DEV .dev_register = snd_jack_dev_register,
sound/core/pcm.c +2 -2
@@ -706,12 +706,12 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, {struct snd_pcm *pcm;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_pcm_dev_free, .dev_register = snd_pcm_dev_register, .dev_disconnect = snd_pcm_dev_disconnect, }; -static struct snd_device_ops internal_ops = { +static const struct snd_device_ops internal_ops = { .dev_free = snd_pcm_dev_free, };
sound/core/rawmidi.c +1 -1
@@ -1621,7 +1621,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, {struct snd_rawmidi *rmidi;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_rawmidi_dev_free, .dev_register = snd_rawmidi_dev_register, .dev_disconnect = snd_rawmidi_dev_disconnect,
sound/core/seq_device.c +1 -1
@@ -193,7 +193,7 @@ int snd_seq_device_new(struct snd_card *card, int device, const char *id, {struct snd_seq_device *dev;int err; -static struct snd_device_ops dops = { +static const struct snd_device_ops dops = { .dev_free = snd_seq_device_dev_free, .dev_register = snd_seq_device_dev_register, .dev_disconnect = snd_seq_device_dev_disconnect,
sound/core/timer.c +1 -1
@@ -936,7 +936,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, {struct snd_timer *timer;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_timer_dev_free, .dev_register = snd_timer_dev_register, .dev_disconnect = snd_timer_dev_disconnect,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 5/58 ALSA: drivers: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/drivers/ml403-ac97cr.c | 2 +- sound/drivers/opl3/opl3_lib.c | 2 +- sound/drivers/opl4/opl4_lib.c | 2 +- sound/drivers/pcsp/pcsp.c | 2 +- sound/drivers/serial-u16550.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
sound/drivers/ml403-ac97cr.c +1 -1
@@ -1076,7 +1076,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, {struct snd_ml403_ac97cr *ml403_ac97cr;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ml403_ac97cr_dev_free, };struct resource *resource;
sound/drivers/opl3/opl3_lib.c +1 -1
@@ -332,7 +332,7 @@ int snd_opl3_new(struct snd_card *card, unsigned short hardware, struct snd_opl3 **ropl3) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_opl3_dev_free, };struct snd_opl3 *opl3;
sound/drivers/opl4/opl4_lib.c +1 -1
@@ -184,7 +184,7 @@ int snd_opl4_create(struct snd_card *card,struct snd_opl4 *opl4;struct snd_opl3 *opl3;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_opl4_dev_free };
sound/drivers/pcsp/pcsp.c +1 -1
@@ -43,7 +43,7 @@ struct snd_pcsp pcsp_chip;static int snd_pcsp_create (struct snd_card *card) { -static struct snd_device_ops ops = { }; +static const struct snd_device_ops ops = { };unsigned int resolution = hrtimer_resolution;int err, div, min_div, order;
sound/drivers/serial-u16550.c +1 -1
@@ -777,7 +777,7 @@ static int snd_uart16550_create(struct snd_card *card, int droponfull, struct snd_uart16550 **ruart) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_uart16550_dev_free, };struct snd_uart16550 *uart;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 6/58 ALSA: i2c: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/i2c/i2c.c | 2 +- sound/i2c/other/ak4113.c | 2 +- sound/i2c/other/ak4114.c | 2 +- sound/i2c/other/ak4117.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
sound/i2c/i2c.c +1 -1
@@ -67,7 +67,7 @@ int snd_i2c_bus_create(struct snd_card *card, const char *name, {struct snd_i2c_bus *bus;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_i2c_bus_dev_free, };
sound/i2c/other/ak4113.c +1 -1
@@ -60,7 +60,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,struct ak4113 *chip;int err;unsigned char reg; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ak4113_dev_free, };
sound/i2c/other/ak4114.c +1 -1
@@ -71,7 +71,7 @@ int snd_ak4114_create(struct snd_card *card,struct ak4114 *chip;int err =0 ;unsigned char reg; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ak4114_dev_free, };
sound/i2c/other/ak4117.c +1 -1
@@ -64,7 +64,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_tstruct ak4117 *chip;int err =0 ;unsigned char reg; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ak4117_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 7/58 ALSA: isa: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/isa/ad1816a/ad1816a_lib.c | 2 +- sound/isa/es1688/es1688_lib.c | 2 +- sound/isa/es18xx.c | 2 +- sound/isa/gus/gus_main.c | 2 +- sound/isa/msnd/msnd_pinnacle.c | 2 +- sound/isa/sb/emu8000.c | 2 +- sound/isa/sb/sb_common.c | 2 +- sound/isa/wss/wss_lib.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
sound/isa/ad1816a/ad1816a_lib.c +1 -1
@@ -577,7 +577,7 @@ int snd_ad1816a_create(struct snd_card *card, unsigned long port, int irq, int dma1, int dma2, struct snd_ad1816a *chip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ad1816a_dev_free, };int error;
sound/isa/es1688/es1688_lib.c +1 -1
@@ -612,7 +612,7 @@ int snd_es1688_create(struct snd_card *card, int dma8, unsigned short hardware) { -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_es1688_dev_free, };
sound/isa/es18xx.c +1 -1
@@ -1753,7 +1753,7 @@ static int snd_es18xx_new_device(struct snd_card *card, int irq, int dma1, int dma2) { struct snd_es18xx *chip = card->private_data; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_es18xx_dev_free, };int err;
sound/isa/gus/gus_main.c +1 -1
@@ -134,7 +134,7 @@ int snd_gus_create(struct snd_card *card, {struct snd_gus_card *gus;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_gus_dev_free, };
sound/isa/msnd/msnd_pinnacle.c +1 -1
@@ -528,7 +528,7 @@ static int snd_msnd_attach(struct snd_card *card) {struct snd_msnd *chip = card->private_data;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_msnd_dev_free, };
sound/isa/sb/emu8000.c +1 -1
@@ -1075,7 +1075,7 @@ snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports,struct snd_seq_device *awe;struct snd_emu8000 *hw;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_emu8000_dev_free, };
sound/isa/sb/sb_common.c +1 -1
@@ -204,7 +204,7 @@ int snd_sbdsp_create(struct snd_card *card, {struct snd_sb *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_sbdsp_dev_free, };
sound/isa/wss/wss_lib.c +1 -1
@@ -1772,7 +1772,7 @@ int snd_wss_create(struct snd_card *card, unsigned short hwshare, struct snd_wss **rchip) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_wss_dev_free, };struct snd_wss *chip;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 8/58 ALSA: hda: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/pci/hda/hda_beep.c | 2 +- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_intel.c | 2 +- sound/pci/hda/hda_tegra.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
sound/pci/hda/hda_beep.c +1 -1
@@ -192,7 +192,7 @@ static int beep_dev_free(struct snd_device *device)*/ int snd_hda_attach_beep_device (struct hda_codec *codec,int nid) { -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = beep_dev_register, .dev_disconnect = beep_dev_disconnect, .dev_free = beep_dev_free,
sound/pci/hda/hda_codec.c +1 -1
@@ -915,7 +915,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,char component[31 ];hda_nid_t fg;int err; -static struct snd_device_ops dev_ops = { +static const struct snd_device_ops dev_ops = { .dev_register = snd_hda_codec_dev_register, .dev_free = snd_hda_codec_dev_free, };
sound/pci/hda/hda_intel.c +1 -1
@@ -1743,7 +1743,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, int dev, unsigned int driver_caps, struct azx **rchip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_disconnect = azx_dev_disconnect, .dev_free = azx_dev_free, };
sound/pci/hda/hda_tegra.c +1 -1
@@ -366,7 +366,7 @@ static int hda_tegra_create(struct snd_card *card, unsigned int driver_caps, struct hda_tegra *hda) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_disconnect = hda_tegra_dev_disconnect, .dev_free = hda_tegra_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 9/58 ALSA: pci: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/pci/ac97/ac97_codec.c | 4 ++-- sound/pci/ad1889.c | 2 +- sound/pci/ak4531_codec.c | 2 +- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/als300.c | 2 +- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- sound/pci/au88x0/au88x0.c | 2 +- sound/pci/aw2/aw2-alsa.c | 2 +- sound/pci/azt3328.c | 2 +- sound/pci/bt87x.c | 2 +- sound/pci/ca0106/ca0106_main.c | 2 +- sound/pci/cmipci.c | 2 +- sound/pci/cs4281.c | 2 +- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs5530.c | 2 +- sound/pci/cs5535audio/cs5535audio.c | 2 +- sound/pci/ctxfi/ctatc.c | 2 +- sound/pci/echoaudio/echoaudio.c | 2 +- sound/pci/emu10k1/emu10k1_main.c | 2 +- sound/pci/emu10k1/emu10k1x.c | 2 +- sound/pci/ens1370.c | 2 +- sound/pci/es1938.c | 2 +- sound/pci/es1968.c | 2 +- sound/pci/fm801.c | 2 +- sound/pci/ice1712/ice1712.c | 2 +- sound/pci/ice1712/ice1724.c | 2 +- sound/pci/intel8x0.c | 2 +- sound/pci/intel8x0m.c | 2 +- sound/pci/korg1212/korg1212.c | 2 +- sound/pci/lola/lola.c | 2 +- sound/pci/lx6464es/lx6464es.c | 2 +- sound/pci/maestro3.c | 2 +- sound/pci/mixart/mixart.c | 2 +- sound/pci/nm256/nm256.c | 2 +- sound/pci/pcxhr/pcxhr.c | 2 +- sound/pci/riptide/riptide.c | 2 +- sound/pci/sis7019.c | 2 +- sound/pci/sonicvibes.c | 2 +- sound/pci/trident/trident_main.c | 2 +- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- sound/pci/vx222/vx222.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- 44 files changed, 45 insertions(+), 45 deletions(-)
sound/pci/ac97/ac97_codec.c +2 -2
@@ -1899,7 +1899,7 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops, {int err;struct snd_ac97_bus *bus; -static struct snd_device_ops dev_ops = { +static const struct snd_device_ops dev_ops = { .dev_free = snd_ac97_bus_dev_free, };
@@ -1999,7 +1999,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,unsigned long end_time;unsigned int reg;const struct ac97_codec_id *pid; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ac97_dev_free, .dev_register = snd_ac97_dev_register, .dev_disconnect = snd_ac97_dev_disconnect,
sound/pci/ad1889.c +1 -1
@@ -847,7 +847,7 @@ snd_ad1889_create(struct snd_card *card,int err;struct snd_ad1889 *chip; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ad1889_dev_free, };
sound/pci/ak4531_codec.c +1 -1
@@ -371,7 +371,7 @@ int snd_ak4531_mixer(struct snd_card *card,unsigned int idx;int err;struct snd_ak4531 *ak4531; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ak4531_dev_free, };
sound/pci/ali5451/ali5451.c +1 -1
@@ -2046,7 +2046,7 @@ static int snd_ali_create(struct snd_card *card,struct snd_ali *codec;int i, err;unsigned short cmdw; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ali_dev_free, };
sound/pci/als300.c +1 -1
@@ -617,7 +617,7 @@ static int snd_als300_create(struct snd_card *card,void *irq_handler;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_als300_dev_free, }; *rchip =NULL ;
sound/pci/atiixp.c +1 -1
@@ -1557,7 +1557,7 @@ static int snd_atiixp_create(struct snd_card *card, struct pci_dev *pci, struct atiixp **r_chip) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_atiixp_dev_free, };struct atiixp *chip;
sound/pci/atiixp_modem.c +1 -1
@@ -1187,7 +1187,7 @@ static int snd_atiixp_create(struct snd_card *card, struct pci_dev *pci, struct atiixp_modem **r_chip) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_atiixp_dev_free, };struct atiixp_modem *chip;
sound/pci/au88x0/au88x0.c +1 -1
@@ -142,7 +142,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip) {vortex_t *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_vortex_dev_free, };
sound/pci/aw2/aw2-alsa.c +1 -1
@@ -223,7 +223,7 @@ static int snd_aw2_create(struct snd_card *card, {struct aw2 *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_aw2_dev_free, };
sound/pci/azt3328.c +1 -1
@@ -2355,7 +2355,7 @@ snd_azf3328_create(struct snd_card *card, {struct snd_azf3328 *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_azf3328_dev_free, };u8 dma_init;
sound/pci/bt87x.c +1 -1
@@ -705,7 +705,7 @@ static int snd_bt87x_create(struct snd_card *card, {struct snd_bt87x *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_bt87x_dev_free };
sound/pci/ca0106/ca0106_main.c +1 -1
@@ -1595,7 +1595,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card,struct snd_ca0106 *chip;struct snd_ca0106_details *c;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ca0106_dev_free, };
sound/pci/cmipci.c +1 -1
@@ -2976,7 +2976,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci, {struct cmipci *cm;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_cmipci_dev_free, };unsigned int val;
sound/pci/cs4281.c +1 -1
@@ -1304,7 +1304,7 @@ static int snd_cs4281_create(struct snd_card *card,struct cs4281 *chip;unsigned int tmp;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_cs4281_dev_free, };
sound/pci/cs46xx/cs46xx_lib.c +1 -1
@@ -3864,7 +3864,7 @@ int snd_cs46xx_create(struct snd_card *card,struct snd_cs46xx_region *region;struct cs_card_type *cp;u16 ss_card, ss_vendor; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_cs46xx_dev_free, };
sound/pci/cs5530.c +1 -1
@@ -104,7 +104,7 @@ static int snd_cs5530_create(struct snd_card *card,void __iomem *mem;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_cs5530_dev_free, }; *rchip =NULL ;
sound/pci/cs5535audio/cs5535audio.c +1 -1
@@ -261,7 +261,7 @@ static int snd_cs5535audio_create(struct snd_card *card,struct cs5535audio *cs5535au;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_cs5535audio_dev_free, };
sound/pci/ctxfi/ctatc.c +1 -1
@@ -1669,7 +1669,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci, struct ct_atc **ratc) {struct ct_atc *atc; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = atc_dev_free, };int err;
sound/pci/echoaudio/echoaudio.c +1 -1
@@ -1856,7 +1856,7 @@ static int snd_echo_create(struct snd_card *card,struct echoaudio *chip;int err;size_t sz; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_echo_dev_free, };
sound/pci/emu10k1/emu10k1_main.c +1 -1
@@ -1791,7 +1791,7 @@ int snd_emu10k1_create(struct snd_card *card,size_t page_table_size;unsigned int silent_page;const struct snd_emu_chip_details *c; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_emu10k1_dev_free, };
sound/pci/emu10k1/emu10k1x.c +1 -1
@@ -886,7 +886,7 @@ static int snd_emu10k1x_create(struct snd_card *card,struct emu10k1x *chip;int err;int ch; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_emu10k1x_dev_free, };
sound/pci/ens1370.c +1 -1
@@ -2041,7 +2041,7 @@ static int snd_ensoniq_create(struct snd_card *card, {struct ensoniq *ensoniq;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ensoniq_dev_free, };
sound/pci/es1938.c +1 -1
@@ -1548,7 +1548,7 @@ static int snd_es1938_create(struct snd_card *card, {struct es1938 *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_es1938_dev_free, };
sound/pci/es1968.c +1 -1
@@ -2656,7 +2656,7 @@ static int snd_es1968_create(struct snd_card *card, int radio_nr, struct es1968 **chip_ret) { - static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_es1968_dev_free, };struct es1968 *chip;
sound/pci/fm801.c +1 -1
@@ -1183,7 +1183,7 @@ static int snd_fm801_create(struct snd_card *card, {struct fm801 *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_fm801_dev_free, };
sound/pci/ice1712/ice1712.c +1 -1
@@ -2474,7 +2474,7 @@ static int snd_ice1712_create(struct snd_card *card, {struct snd_ice1712 *ice;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ice1712_dev_free, };
sound/pci/ice1712/ice1724.c +1 -1
@@ -2502,7 +2502,7 @@ static int snd_vt1724_create(struct snd_card *card, {struct snd_ice1712 *ice;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_vt1724_dev_free, };
sound/pci/intel8x0.c +1 -1
@@ -2897,7 +2897,7 @@ static int snd_intel8x0_create(struct snd_card *card,unsigned int i;unsigned int int_sta_masks;struct ichdev *ichdev; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_intel8x0_dev_free, };
sound/pci/intel8x0m.c +1 -1
@@ -1079,7 +1079,7 @@ static int snd_intel8x0m_create(struct snd_card *card,unsigned int i;unsigned int int_sta_masks;struct ichdev *ichdev; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_intel8x0m_dev_free, };static struct ich_reg_info intel_regs[2 ] = {
sound/pci/korg1212/korg1212.c +1 -1
@@ -2153,7 +2153,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,struct snd_korg1212 * korg1212;const struct firmware *dsp_code; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_korg1212_dev_free, };
sound/pci/lola/lola.c +1 -1
@@ -559,7 +559,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,struct lola *chip;int err;unsigned int dever; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = lola_dev_free, };
sound/pci/lx6464es/lx6464es.c +1 -1
@@ -938,7 +938,7 @@ static int snd_lx6464es_create(struct snd_card *card,struct lx6464es *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_lx6464es_dev_free, };
sound/pci/maestro3.c +1 -1
@@ -2522,7 +2522,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,struct snd_m3 *chip;int i, err;const struct snd_pci_quirk *quirk; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_m3_dev_free, };
sound/pci/mixart/mixart.c +1 -1
@@ -1030,7 +1030,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int {int err;struct snd_mixart *chip; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_mixart_chip_dev_free, };
sound/pci/nm256/nm256.c +1 -1
@@ -1471,7 +1471,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, {struct nm256 *chip;int err, pval; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_nm256_dev_free, };u32 addr;
sound/pci/pcxhr/pcxhr.c +1 -1
@@ -1179,7 +1179,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr, {int err;struct snd_pcxhr *chip; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = pcxhr_chip_dev_free, };
sound/pci/riptide/riptide.c +1 -1
@@ -1824,7 +1824,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,struct snd_riptide *chip;struct riptideport *hwport;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_riptide_dev_free, };
sound/pci/sis7019.c +1 -1
@@ -1280,7 +1280,7 @@ static int sis_chip_create(struct snd_card *card, {struct sis7019 *sis = card->private_data;struct voice *voice; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = sis_dev_free, };int rc;
sound/pci/sonicvibes.c +1 -1
@@ -1221,7 +1221,7 @@ static int snd_sonicvibes_create(struct snd_card *card,struct sonicvibes *sonic;unsigned int dmaa, dmac;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_sonicvibes_dev_free, };
sound/pci/trident/trident_main.c +1 -1
@@ -3487,7 +3487,7 @@ int snd_trident_create(struct snd_card *card,int i, err;struct snd_trident_voice *voice;struct snd_trident_pcm_mixer *tmix; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_trident_dev_free, };
sound/pci/via82xx.c +1 -1
@@ -2332,7 +2332,7 @@ static int snd_via82xx_create(struct snd_card *card, {struct via82xx *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_via82xx_dev_free, };
sound/pci/via82xx_modem.c +1 -1
@@ -1074,7 +1074,7 @@ static int snd_via82xx_create(struct snd_card *card, {struct via82xx_modem *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_via82xx_dev_free, };
sound/pci/vx222/vx222.c +1 -1
@@ -128,7 +128,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,struct vx_core *chip;struct snd_vx222 *vx;int i, err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_vx222_dev_free, };struct snd_vx_ops *vx_ops;
sound/pci/ymfpci/ymfpci_main.c +1 -1
@@ -2327,7 +2327,7 @@ int snd_ymfpci_create(struct snd_card *card, {struct snd_ymfpci *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_ymfpci_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 10/58 ALSA: usb: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/mixer.c +1 -1
@@ -3407,7 +3407,7 @@ static int create_keep_iface_ctl(struct usb_mixer_interface *mixer)int snd_usb_create_mixer (struct snd_usb_audio *chip,int ctrlif,int ignore_error) { -static struct snd_device_ops dev_ops = { +static const struct snd_device_ops dev_ops = { .dev_free = snd_usb_mixer_dev_free };struct usb_mixer_interface *mixer;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 11/58 ALSA: aoa: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/aoa/aoa.h | 2 +- sound/aoa/codecs/onyx.c | 2 +- sound/aoa/codecs/tas.c | 2 +- sound/aoa/codecs/toonie.c | 2 +- sound/aoa/core/alsa.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
sound/aoa/aoa.h +1 -1
@@ -116,7 +116,7 @@ struct aoa_card { };extern int aoa_snd_device_new (enum snd_device_type type, -void * device_data,struct snd_device_ops * ops); +void *device_data,const struct snd_device_ops *ops);extern struct snd_card *aoa_get_card (void );extern int aoa_snd_ctl_add (struct snd_kcontrol * control);
sound/aoa/codecs/onyx.c +1 -1
@@ -97,7 +97,7 @@ static int onyx_dev_register(struct snd_device *dev)return 0 ; } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = onyx_dev_register, };
sound/aoa/codecs/tas.c +1 -1
@@ -217,7 +217,7 @@ static int tas_dev_register(struct snd_device *dev)return 0 ; } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = tas_dev_register, };
sound/aoa/codecs/toonie.c +1 -1
@@ -30,7 +30,7 @@ static int toonie_dev_register(struct snd_device *dev)return 0 ; } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = toonie_dev_register, };
sound/aoa/core/alsa.c +1 -1
@@ -59,7 +59,7 @@ void aoa_alsa_cleanup(void) }int aoa_snd_device_new (enum snd_device_type type, -void * device_data,struct snd_device_ops * ops) +void *device_data,const struct snd_device_ops *ops) {struct snd_card *card =aoa_get_card ();int err;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 12/58 ALSA: mips: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/mips/hal2.c | 2 +- sound/mips/sgio2audio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/mips/hal2.c +1 -1
@@ -732,7 +732,7 @@ static int hal2_dev_free(struct snd_device *device)return 0 ; } -static struct snd_device_ops hal2_ops = { +static const struct snd_device_ops hal2_ops = { .dev_free = hal2_dev_free, };
sound/mips/sgio2audio.c +1 -1
@@ -787,7 +787,7 @@ static int snd_sgio2audio_dev_free(struct snd_device *device)return snd_sgio2audio_free (chip); } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_sgio2audio_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 13/58 ALSA: parisc: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/parisc/harmony.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/parisc/harmony.c +1 -1
@@ -881,7 +881,7 @@ snd_harmony_create(struct snd_card *card, {int err;struct snd_harmony *h; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_harmony_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 14/58 ALSA: pcmcia: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/pcmcia/pdaudiocf/pdaudiocf.c | 2 +- sound/pcmcia/vx/vxpocket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/pcmcia/pdaudiocf/pdaudiocf.c +1 -1
@@ -82,7 +82,7 @@ static int snd_pdacf_probe(struct pcmcia_device *link)int i, err;struct snd_pdacf *pdacf;struct snd_card *card; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_pdacf_dev_free, };
sound/pcmcia/vx/vxpocket.c +1 -1
@@ -126,7 +126,7 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl, {struct vx_core *chip;struct snd_vxpocket *vxp; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_vxpocket_dev_free, };int err;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 15/58 ALSA: ppc: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/ppc/pmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/ppc/pmac.c +1 -1
@@ -1143,7 +1143,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)int i, err;unsigned int irq;unsigned long ctrl_addr, txdma_addr, rxdma_addr; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_pmac_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 16/58 ALSA: sparc: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/sparc/amd7930.c | 2 +- sound/sparc/cs4231.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/sparc/amd7930.c +1 -1
@@ -912,7 +912,7 @@ static int snd_amd7930_dev_free(struct snd_device *device)return snd_amd7930_free (amd); } -static struct snd_device_ops snd_amd7930_dev_ops = { +static const struct snd_device_ops snd_amd7930_dev_ops = { .dev_free = snd_amd7930_dev_free, };
sound/sparc/cs4231.c +2 -2
@@ -1771,7 +1771,7 @@ static int snd_cs4231_sbus_dev_free(struct snd_device *device)return snd_cs4231_sbus_free (cp); } -static struct snd_device_ops snd_cs4231_sbus_dev_ops = { +static const struct snd_device_ops snd_cs4231_sbus_dev_ops = { .dev_free = snd_cs4231_sbus_dev_free, };
@@ -1937,7 +1937,7 @@ static int snd_cs4231_ebus_dev_free(struct snd_device *device)return snd_cs4231_ebus_free (cp); } -static struct snd_device_ops snd_cs4231_ebus_dev_ops = { +static const struct snd_device_ops snd_cs4231_ebus_dev_ops = { .dev_free = snd_cs4231_ebus_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 17/58 ALSA: sh: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/sh/sh_dac_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/sh/sh_dac_audio.c +1 -1
@@ -325,7 +325,7 @@ static int snd_sh_dac_create(struct snd_card *card,struct snd_sh_dac *chip;int err; -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_sh_dac_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 18/58 ALSA: spi: Constify snd_device_ops definitions
In reply to Takashi IwaiNow we may declare const for snd_device_ops definitions, so let's do it for optimization.
There should be no functional changes by this patch.
--- sound/spi/at73c213.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/spi/at73c213.c +1 -1
@@ -874,7 +874,7 @@ static int snd_at73c213_dev_free(struct snd_device *device)static int snd_at73c213_dev_init (struct snd_card *card,struct spi_device *spi) { -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_at73c213_dev_free, };struct snd_at73c213 *chip =get_chip (card);
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 19/58 ALSA: docs: Constify snd_device_ops definitions
In reply to Takashi IwaiUpdate the documentation for adding the const prefix to snd_device_ops definitions as well.
--- Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/sound/kernel-api/writing-an-alsa-driver.rst +3 -3
@@ -259,7 +259,7 @@ to details explained in the following section. { struct mychip *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mychip_dev_free, };
@@ -675,7 +675,7 @@ low-level device with a specified ``ops``, :: - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mychip_dev_free, }; ....
@@ -761,7 +761,7 @@ destructor and PCI entries. Example code is shown first, below. { struct mychip *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mychip_dev_free, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 20/58 ALSA: timer: Constify snd_timer_hardware definitions
In reply to Takashi IwaiMost of snd_timer_hardware definitions do simply copying to another struct as-is. Mark them as const for further optimization.
There should be no functional changes by this patch.
--- sound/core/pcm_timer.c | 2 +- sound/core/timer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/core/pcm_timer.c +1 -1
@@ -75,7 +75,7 @@ static int snd_pcm_timer_stop(struct snd_timer * timer)return 0 ; } -static struct snd_timer_hardware snd_pcm_timer = +static const struct snd_timer_hardware snd_pcm_timer = { .flags =SNDRV_TIMER_HW_AUTO |SNDRV_TIMER_HW_SLAVE , .resolution =0 ,
sound/core/timer.c +1 -1
@@ -1199,7 +1199,7 @@ static int snd_timer_s_close(struct snd_timer *timer)return 0 ; } -static struct snd_timer_hardware snd_timer_system = +static const struct snd_timer_hardware snd_timer_system = { .flags =SNDRV_TIMER_HW_FIRST |SNDRV_TIMER_HW_TASKLET , .resolution =1000000000L /HZ ,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 21/58 ALSA: Constify snd_timer_hardware definitions
In reply to Takashi IwaiMost of snd_timer_hardware definitions do simply copying to another struct as-is. Mark them as const for further optimization.
There should be no functional changes by this patch.
--- sound/drivers/opl3/opl3_lib.c | 4 ++-- sound/isa/gus/gus_timer.c | 4 ++-- sound/isa/wss/wss_lib.c | 2 +- sound/pci/emu10k1/timer.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- sound/sparc/cs4231.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
sound/drivers/opl3/opl3_lib.c +2 -2
@@ -214,7 +214,7 @@ static int snd_opl3_timer2_stop(struct snd_timer * timer)*/ -static struct snd_timer_hardware snd_opl3_timer1 = +static const struct snd_timer_hardware snd_opl3_timer1 = { .flags =SNDRV_TIMER_HW_STOP , .resolution =80000 ,
@@ -223,7 +223,7 @@ static struct snd_timer_hardware snd_opl3_timer1 = .stop = snd_opl3_timer1_stop, }; -static struct snd_timer_hardware snd_opl3_timer2 = +static const struct snd_timer_hardware snd_opl3_timer2 = { .flags =SNDRV_TIMER_HW_STOP , .resolution =320000 ,
sound/isa/gus/gus_timer.c +2 -2
@@ -108,7 +108,7 @@ static void snd_gf1_interrupt_timer2(struct snd_gus_card * gus)*/ -static struct snd_timer_hardware snd_gf1_timer1 = +static const struct snd_timer_hardware snd_gf1_timer1 = { .flags =SNDRV_TIMER_HW_STOP , .resolution =80000 ,
@@ -117,7 +117,7 @@ static struct snd_timer_hardware snd_gf1_timer1 = .stop = snd_gf1_timer1_stop, }; -static struct snd_timer_hardware snd_gf1_timer2 = +static const struct snd_timer_hardware snd_gf1_timer2 = { .flags =SNDRV_TIMER_HW_STOP , .resolution =320000 ,
sound/isa/wss/wss_lib.c +1 -1
@@ -961,7 +961,7 @@ static int snd_wss_timer_close(struct snd_timer *timer)return 0 ; } -static struct snd_timer_hardware snd_wss_timer_table = +static const struct snd_timer_hardware snd_wss_timer_table = { .flags =SNDRV_TIMER_HW_AUTO , .resolution =9945 ,
sound/pci/emu10k1/timer.c +1 -1
@@ -52,7 +52,7 @@ static int snd_emu10k1_timer_precise_resolution(struct snd_timer *timer,return 0 ; } -static struct snd_timer_hardware snd_emu10k1_timer_hw = { +static const struct snd_timer_hardware snd_emu10k1_timer_hw = { .flags =SNDRV_TIMER_HW_AUTO , .resolution =20833 ,/* 1 sample @ 48KHZ = 20.833...us */ .ticks =1024 ,
sound/pci/ymfpci/ymfpci_main.c +1 -1
@@ -1908,7 +1908,7 @@ static int snd_ymfpci_timer_precise_resolution(struct snd_timer *timer,return 0 ; } -static struct snd_timer_hardware snd_ymfpci_timer_hw = { +static const struct snd_timer_hardware snd_ymfpci_timer_hw = { .flags =SNDRV_TIMER_HW_AUTO , .resolution =10417 ,/* 1 / 96 kHz = 10.41666...us */ .ticks =0x10000 ,
sound/sparc/cs4231.c +1 -1
@@ -869,7 +869,7 @@ static int snd_cs4231_timer_close(struct snd_timer *timer)return 0 ; } -static struct snd_timer_hardware snd_cs4231_timer_table = { +static const struct snd_timer_hardware snd_cs4231_timer_table = { .flags =SNDRV_TIMER_HW_AUTO , .resolution =9945 , .ticks =65535 ,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 22/58 ALSA: ac97: Treat snd_ac97_bus_ops as const
In reply to Takashi IwaiThis is a preliminary patch to allow const for snd_ac97_bus_ops definitions in each driver's code. The ops reference is read-only, hence it can be declared as const for further optimization.
There should be no functional changes by this patch.
--- include/sound/ac97_codec.h | 5 +++-- sound/ac97_bus.c | 2 +- sound/pci/ac97/ac97_codec.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-)
include/sound/ac97_codec.h +3 -2
@@ -197,7 +197,7 @@ struct snd_ac97_bus_ops {struct snd_ac97_bus {/* -- lowlevel (hardware) driver specific -- */ -struct snd_ac97_bus_ops *ops; +const struct snd_ac97_bus_ops *ops;void *private_data;void (*private_free) (struct snd_ac97_bus *bus);/* --- */
@@ -310,7 +310,8 @@ static inline int ac97_can_spdif(struct snd_ac97 * ac97)/* functions */ /* create new AC97 bus */ -int snd_ac97_bus (struct snd_card *card,int num,struct snd_ac97_bus_ops *ops, +int snd_ac97_bus (struct snd_card *card,int num, +const struct snd_ac97_bus_ops *ops,void *private_data,struct snd_ac97_bus **rbus);/* create mixer controls */ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
sound/ac97_bus.c +1 -1
@@ -55,7 +55,7 @@ static bool snd_ac97_check_id(struct snd_ac97 *ac97, unsigned int id,int snd_ac97_reset (struct snd_ac97 *ac97,bool try_warm,unsigned int id,unsigned int id_mask) { -struct snd_ac97_bus_ops *ops = ac97->bus->ops; +const struct snd_ac97_bus_ops *ops = ac97->bus->ops;if (try_warm && ops->warm_reset) { ops->warm_reset (ac97);
sound/pci/ac97/ac97_codec.c +2 -1
@@ -1894,7 +1894,8 @@ static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem)* * Return: Zero if successful, or a negative error code on failure. */ -int snd_ac97_bus (struct snd_card *card,int num,struct snd_ac97_bus_ops *ops, +int snd_ac97_bus (struct snd_card *card,int num, +const struct snd_ac97_bus_ops *ops,void *private_data,struct snd_ac97_bus **rbus) {int err;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 23/58 ALSA: ac97: Constify snd_ac97_bus_ops definitions
In reply to Takashi IwaiNow 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.
--- sound/ac97/snd_ac97_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/ac97/snd_ac97_compat.c +1 -1
@@ -53,7 +53,7 @@ static unsigned short compat_ac97_read(struct snd_ac97 *ac97,return actrl->ops->read (actrl, ac97->num, reg); } -static struct snd_ac97_bus_ops compat_snd_ac97_bus_ops = { +static const struct snd_ac97_bus_ops compat_snd_ac97_bus_ops = { .reset = compat_ac97_reset, .warm_reset = compat_ac97_warm_reset, .write = compat_ac97_write,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 24/58 ALSA: arm: Constify snd_ac97_bus_ops definitions
In reply to Takashi IwaiNow 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.
--- sound/arm/aaci.c | 2 +- sound/arm/pxa2xx-ac97.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/arm/aaci.c +1 -1
@@ -811,7 +811,7 @@ static const struct ac97_pcm ac97_defs[] = { } }; -static struct snd_ac97_bus_ops aaci_bus_ops = { +static const struct snd_ac97_bus_ops aaci_bus_ops = { .write = aaci_ac97_write, .read = aaci_ac97_read, };
sound/arm/pxa2xx-ac97.c +1 -1
@@ -52,7 +52,7 @@ static void pxa2xx_ac97_legacy_write(struct snd_ac97 *ac97, ret =pxa2xx_ac97_write (ac97->num, reg, val); } -static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { +static const struct snd_ac97_bus_ops pxa2xx_ac97_ops = { .read = pxa2xx_ac97_legacy_read, .write = pxa2xx_ac97_legacy_write, .reset = pxa2xx_ac97_legacy_reset,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 25/58 ALSA: atmel: Constify snd_ac97_bus_ops definitions
In reply to Takashi IwaiNow 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.
--- sound/atmel/ac97c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/atmel/ac97c.c +1 -1
@@ -702,7 +702,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev)struct atmel_ac97c *chip;struct resource *regs;struct clk *pclk; -static struct snd_ac97_bus_ops ops = { +static const struct snd_ac97_bus_ops ops = { .write = atmel_ac97c_write, .read = atmel_ac97c_read, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 26/58 ALSA: drivers: Constify snd_ac97_bus_ops definitions
In reply to Takashi IwaiNow 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.
--- sound/drivers/ml403-ac97cr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/drivers/ml403-ac97cr.c +1 -1
@@ -1172,7 +1172,7 @@ snd_ml403_ac97cr_mixer(struct snd_ml403_ac97cr *ml403_ac97cr)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_ml403_ac97cr_codec_write, .read = snd_ml403_ac97cr_codec_read, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 27/58 ALSA: pci: Constify snd_ac97_bus_ops definitions
In reply to Takashi IwaiNow 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.
--- sound/pci/ad1889.c | 2 +- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/als300.c | 2 +- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- sound/pci/au88x0/au88x0_mixer.c | 2 +- sound/pci/azt3328.c | 2 +- sound/pci/ca0106/ca0106_main.c | 2 +- sound/pci/cs4281.c | 2 +- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs5535audio/cs5535audio.c | 2 +- sound/pci/emu10k1/emu10k1x.c | 2 +- sound/pci/emu10k1/emumixer.c | 2 +- sound/pci/ens1370.c | 2 +- sound/pci/es1968.c | 2 +- sound/pci/fm801.c | 2 +- sound/pci/ice1712/ice1712.c | 4 ++-- sound/pci/ice1712/ice1724.c | 2 +- sound/pci/intel8x0.c | 6 +++--- sound/pci/intel8x0m.c | 2 +- sound/pci/maestro3.c | 2 +- sound/pci/nm256/nm256.c | 2 +- sound/pci/riptide/riptide.c | 2 +- sound/pci/sis7019.c | 2 +- sound/pci/trident/trident_main.c | 2 +- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- 28 files changed, 31 insertions(+), 31 deletions(-)
sound/pci/ad1889.c +1 -1
@@ -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, };
sound/pci/ali5451/ali5451.c +1 -1
@@ -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, };
sound/pci/als300.c +1 -1
@@ -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, };
sound/pci/atiixp.c +1 -1
@@ -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, };
sound/pci/atiixp_modem.c +1 -1
@@ -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, };
sound/pci/au88x0/au88x0_mixer.c +1 -1
@@ -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, };
sound/pci/azt3328.c +1 -1
@@ -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, };
sound/pci/ca0106/ca0106_main.c +1 -1
@@ -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, };
sound/pci/cs4281.c +1 -1
@@ -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, };
sound/pci/cs46xx/cs46xx_lib.c +1 -1
@@ -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
sound/pci/cs5535audio/cs5535audio.c +1 -1
@@ -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, };
sound/pci/emu10k1/emu10k1x.c +1 -1
@@ -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, };
sound/pci/emu10k1/emumixer.c +1 -1
@@ -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, };
sound/pci/ens1370.c +1 -1
@@ -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,
sound/pci/es1968.c +1 -1
@@ -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, };
sound/pci/fm801.c +1 -1
@@ -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, };
sound/pci/ice1712/ice1712.c +2 -2
@@ -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, };
sound/pci/ice1712/ice1724.c +1 -1
@@ -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, };
sound/pci/intel8x0.c +3 -3
@@ -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, };
sound/pci/intel8x0m.c +1 -1
@@ -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, };
sound/pci/maestro3.c +1 -1
@@ -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, };
sound/pci/nm256/nm256.c +1 -1
@@ -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,
sound/pci/riptide/riptide.c +1 -1
@@ -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, };
sound/pci/sis7019.c +1 -1
@@ -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, };
sound/pci/trident/trident_main.c +1 -1
@@ -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, };
sound/pci/via82xx.c +1 -1
@@ -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,
sound/pci/via82xx_modem.c +1 -1
@@ -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,
sound/pci/ymfpci/ymfpci_main.c +1 -1
@@ -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, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 28/58 ALSA: info: Make snd_info_entry_ops as const
In reply to Takashi IwaiThe reference to snd_info_entry_ops is rather read-only, so declare it as a const pointer. This allows a bit more optimization.
There should be no functional changes by this patch.
--- Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 2 +- include/sound/info.h | 2 +- sound/drivers/opl4/opl4_proc.c | 2 +- sound/isa/gus/gus_mem_proc.c | 2 +- sound/pci/cs4281.c | 4 ++-- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/emu10k1/emuproc.c | 2 +- sound/pci/mixart/mixart.c | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-)
Documentation/sound/kernel-api/writing-an-alsa-driver.rst +1 -1
@@ -3912,7 +3912,7 @@ For a raw-data proc-file, set the attributes as follows: :: - static struct snd_info_entry_ops my_file_io_ops = { + static const struct snd_info_entry_ops my_file_io_ops = { .read = my_file_io_read, };
include/sound/info.h +1 -1
@@ -64,7 +64,7 @@ struct snd_info_entry {unsigned short content;union {struct snd_info_entry_text text; -struct snd_info_entry_ops *ops; +const struct snd_info_entry_ops *ops; } c;struct snd_info_entry *parent;struct module *module;
sound/drivers/opl4/opl4_proc.c +1 -1
@@ -76,7 +76,7 @@ static ssize_t snd_opl4_mem_proc_write(struct snd_info_entry *entry,return count; } -static struct snd_info_entry_ops snd_opl4_mem_proc_ops = { +static const struct snd_info_entry_ops snd_opl4_mem_proc_ops = { .open = snd_opl4_mem_proc_open, .release = snd_opl4_mem_proc_release, .read = snd_opl4_mem_proc_read,
sound/isa/gus/gus_mem_proc.c +1 -1
@@ -37,7 +37,7 @@ static void snd_gf1_mem_proc_free(struct snd_info_entry *entry)kfree (priv); } -static struct snd_info_entry_ops snd_gf1_mem_proc_ops = { +static const struct snd_info_entry_ops snd_gf1_mem_proc_ops = { .read = snd_gf1_mem_proc_dump, };
sound/pci/cs4281.c +2 -2
@@ -1129,11 +1129,11 @@ static ssize_t snd_cs4281_BA1_read(struct snd_info_entry *entry,return count; } -static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { +static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { .read = snd_cs4281_BA0_read, }; -static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { +static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { .read = snd_cs4281_BA1_read, };
sound/pci/cs46xx/cs46xx_lib.c +1 -1
@@ -2815,7 +2815,7 @@ static ssize_t snd_cs46xx_io_read(struct snd_info_entry *entry,return count; } -static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { +static const struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { .read = snd_cs46xx_io_read, };
sound/pci/emu10k1/emuproc.c +1 -1
@@ -545,7 +545,7 @@ static void snd_emu_proc_ptr_reg_read20c(struct snd_info_entry *entry, }#endif -static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = { +static const struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = { .read = snd_emu10k1_fx8010_read, };
sound/pci/mixart/mixart.c +2 -2
@@ -1153,11 +1153,11 @@ static ssize_t snd_mixart_BA1_read(struct snd_info_entry *entry,return count; } -static struct snd_info_entry_ops snd_mixart_proc_ops_BA0 = { +static const struct snd_info_entry_ops snd_mixart_proc_ops_BA0 = { .read = snd_mixart_BA0_read, }; -static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = { +static const struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = { .read = snd_mixart_BA1_read, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 29/58 ALSA: seq: Constify struct snd_midi_op
In reply to Takashi IwaiChange the argument of snd_midi_process_event() to receive a const snd_midi_op pointer and its callers respectively. This allows further optimizations.
There should be no functional changes by this patch.
--- include/sound/seq_midi_emul.h | 3 ++- sound/core/seq/seq_midi_emul.c | 37 ++++++++++++++++++++++--------------- sound/drivers/opl3/opl3_seq.c | 2 +- sound/drivers/opl3/opl3_voice.h | 2 +- sound/drivers/opl4/opl4_seq.c | 2 +- sound/synth/emux/emux_seq.c | 2 +- 6 files changed, 28 insertions(+), 20 deletions(-)
include/sound/seq_midi_emul.h +2 -1
@@ -174,7 +174,8 @@ enum { };/* Prototypes for midi_process.c */ -void snd_midi_process_event (struct snd_midi_op *ops,struct snd_seq_event *ev, +void snd_midi_process_event (const struct snd_midi_op *ops, +struct snd_seq_event *ev,struct snd_midi_channel_set *chanset);void snd_midi_channel_set_clear (struct snd_midi_channel_set *chset);struct snd_midi_channel_set *snd_midi_channel_alloc_set (int n);
sound/core/seq/seq_midi_emul.c +22 -15
@@ -30,22 +30,25 @@ MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI emulation."MODULE_LICENSE ("GPL" );/* Prototypes for static functions */ -static void note_off (struct snd_midi_op *ops,void *drv, +static void note_off (const struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan,int note,int vel); -static void do_control (struct snd_midi_op *ops,void *private, +static void do_control (const struct snd_midi_op *ops,void *private,struct snd_midi_channel_set *chset,struct snd_midi_channel *chan,int control,int value); -static void rpn (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan, +static void rpn (const struct snd_midi_op *ops,void *drv, +struct snd_midi_channel *chan,struct snd_midi_channel_set *chset); -static void nrpn (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan, +static void nrpn (const struct snd_midi_op *ops,void *drv, +struct snd_midi_channel *chan,struct snd_midi_channel_set *chset); -static void sysex (struct snd_midi_op *ops,void *private,unsigned char *sysex, +static void sysex (const struct snd_midi_op *ops,void *private, +unsigned char *sysex,int len,struct snd_midi_channel_set *chset); -static void all_sounds_off (struct snd_midi_op *ops,void *private, +static void all_sounds_off (const struct snd_midi_op *ops,void *private,struct snd_midi_channel *chan); -static void all_notes_off (struct snd_midi_op *ops,void *private, +static void all_notes_off (const struct snd_midi_op *ops,void *private,struct snd_midi_channel *chan);static void snd_midi_reset_controllers (struct snd_midi_channel *chan);static void reset_all_channels (struct snd_midi_channel_set *chset);
@@ -66,7 +69,7 @@ static void reset_all_channels(struct snd_midi_channel_set *chset);* be interpreted. */ void -snd_midi_process_event (struct snd_midi_op *ops, +snd_midi_process_event (const struct snd_midi_op *ops,struct snd_seq_event *ev,struct snd_midi_channel_set *chanset) {
@@ -229,7 +232,8 @@ EXPORT_SYMBOL(snd_midi_process_event);* release note */ static void -note_off (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan, +note_off (const struct snd_midi_op *ops,void *drv, +struct snd_midi_channel *chan,int note,int vel) {if (chan->gm_hold) {
@@ -251,7 +255,8 @@ note_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan,* events that need to take place immediately to the driver. */ static void -do_control (struct snd_midi_op *ops,void *drv,struct snd_midi_channel_set *chset, +do_control (const struct snd_midi_op *ops,void *drv, +struct snd_midi_channel_set *chset,struct snd_midi_channel *chan,int control,int value) {int i;
@@ -402,7 +407,7 @@ EXPORT_SYMBOL(snd_midi_channel_set_clear);* Process a rpn message. */ static void -rpn (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan, +rpn (const struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan,struct snd_midi_channel_set *chset) {int type;
@@ -442,7 +447,7 @@ rpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan,* Process an nrpn message. */ static void -nrpn (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan, +nrpn (const struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan,struct snd_midi_channel_set *chset) {/* parse XG NRPNs here if possible */
@@ -470,7 +475,7 @@ get_channel(unsigned char cmd)* Process a sysex message. */ static void -sysex (struct snd_midi_op *ops,void *private,unsigned char *buf,int len, +sysex (const struct snd_midi_op *ops,void *private,unsigned char *buf,int len,struct snd_midi_channel_set *chset) {/* GM on */
@@ -584,7 +589,8 @@ sysex(struct snd_midi_op *ops, void *private, unsigned char *buf, int len,* all sound off */ static void -all_sounds_off (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan) +all_sounds_off (const struct snd_midi_op *ops,void *drv, +struct snd_midi_channel *chan) {int n;
@@ -602,7 +608,8 @@ all_sounds_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan* all notes off */ static void -all_notes_off (struct snd_midi_op *ops,void *drv,struct snd_midi_channel *chan) +all_notes_off (const struct snd_midi_op *ops,void *drv, +struct snd_midi_channel *chan) {int n;
sound/drivers/opl3/opl3_seq.c +1 -1
@@ -128,7 +128,7 @@ static int snd_opl3_synth_unuse(void *private_data, struct snd_seq_port_subscrib/* * MIDI emulation operators */ -struct snd_midi_op opl3_ops = { +const struct snd_midi_op opl3_ops = { .note_on = snd_opl3_note_on, .note_off = snd_opl3_note_off, .key_press = snd_opl3_key_press,
sound/drivers/opl3/opl3_voice.h +1 -1
@@ -41,6 +41,6 @@ void snd_opl3_free_seq_oss(struct snd_opl3 *opl3);extern char snd_opl3_regmap[MAX_OPL2_VOICES ][4 ];extern bool use_internal_drums; -extern struct snd_midi_op opl3_ops; +extern const struct snd_midi_op opl3_ops;#endif
sound/drivers/opl4/opl4_seq.c +1 -1
@@ -100,7 +100,7 @@ static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribereturn 0 ; } -static struct snd_midi_op opl4_ops = { +static const struct snd_midi_op opl4_ops = { .note_on = snd_opl4_note_on, .note_off = snd_opl4_note_off, .note_terminate = snd_opl4_terminate_note,
sound/synth/emux/emux_seq.c +1 -1
@@ -19,7 +19,7 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf/* * MIDI emulation operators */ -static struct snd_midi_op emux_ops = { +static const struct snd_midi_op emux_ops = { .note_on = snd_emux_note_on, .note_off = snd_emux_note_off, .key_press = snd_emux_key_press,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 30/58 ALSA: vx: Constify snd_vx_hardware and snd_vx_ops definitions
In reply to Takashi IwaiBoth snd_vx_hardware and snd_vx_ops are only referred without modification, hence they can be constified gracefully for further optimizations.
There should be no functional changes by this patch.
--- include/sound/vx_core.h | 9 +++++---- sound/drivers/vx/vx_core.c | 5 +++-- sound/pci/vx222/vx222.c | 12 ++++++------ sound/pci/vx222/vx222.h | 4 ++-- sound/pci/vx222/vx222_ops.c | 4 ++-- sound/pcmcia/vx/vxp_ops.c | 2 +- sound/pcmcia/vx/vxpocket.c | 4 ++-- sound/pcmcia/vx/vxpocket.h | 2 +- 8 files changed, 22 insertions(+), 20 deletions(-)
include/sound/vx_core.h +5 -4
@@ -147,8 +147,8 @@ struct vx_core {/* ports are defined externally */ /* low-level functions */ -struct snd_vx_hardware *hw; -struct snd_vx_ops *ops; +const struct snd_vx_hardware *hw; +const struct snd_vx_ops *ops;struct mutex lock;
@@ -193,8 +193,9 @@ struct vx_core {/* * constructor */ -struct vx_core *snd_vx_create (struct snd_card *card,struct snd_vx_hardware *hw, -struct snd_vx_ops *ops,int extra_size); +struct vx_core *snd_vx_create (struct snd_card *card, +const struct snd_vx_hardware *hw, +const struct snd_vx_ops *ops,int extra_size);int snd_vx_setup_firmware (struct vx_core *chip);int snd_vx_load_boot_image (struct vx_core *chip,const struct firmware *dsp);int snd_vx_dsp_boot (struct vx_core *chip,const struct firmware *dsp);
sound/drivers/vx/vx_core.c +3 -2
@@ -765,8 +765,9 @@ EXPORT_SYMBOL(snd_vx_resume);* * return the instance pointer if successful, NULL in error. */ -struct vx_core *snd_vx_create (struct snd_card *card,struct snd_vx_hardware *hw, -struct snd_vx_ops *ops, +struct vx_core *snd_vx_create (struct snd_card *card, +const struct snd_vx_hardware *hw, +const struct snd_vx_ops *ops,int extra_size) {struct vx_core *chip;
sound/pci/vx222/vx222.c +6 -6
@@ -62,7 +62,7 @@ MODULE_DEVICE_TABLE(pci, snd_vx222_ids); static const DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0); static const DECLARE_TLV_DB_SCALE(db_scale_akm, -7350, 50, 0); -static struct snd_vx_hardware vx222_old_hw = { +static const struct snd_vx_hardware vx222_old_hw = { .name ="VX222/Old" , .type =VX_TYPE_BOARD ,
@@ -74,7 +74,7 @@ static struct snd_vx_hardware vx222_old_hw = { .output_level_db_scale = db_scale_old_vol, }; -static struct snd_vx_hardware vx222_v2_hw = { +static const struct snd_vx_hardware vx222_v2_hw = { .name ="VX222/v2" , .type =VX_TYPE_V2 ,
@@ -86,7 +86,7 @@ static struct snd_vx_hardware vx222_v2_hw = { .output_level_db_scale = db_scale_akm, }; -static struct snd_vx_hardware vx222_mic_hw = { +static const struct snd_vx_hardware vx222_mic_hw = { .name ="VX222/Mic" , .type =VX_TYPE_MIC ,
@@ -122,7 +122,7 @@ static int snd_vx222_dev_free(struct snd_device *device)static int snd_vx222_create (struct snd_card *card,struct pci_dev *pci, -struct snd_vx_hardware *hw, +const struct snd_vx_hardware *hw,struct snd_vx222 **rchip) {struct vx_core *chip;
@@ -131,7 +131,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,static const struct snd_device_ops ops = { .dev_free = snd_vx222_dev_free, }; -struct snd_vx_ops *vx_ops; +const struct snd_vx_ops *vx_ops;/* enable PCI device */ if ((err =pci_enable_device (pci)) <0 )
@@ -180,7 +180,7 @@ static int snd_vx222_probe(struct pci_dev *pci, {static int dev;struct snd_card *card; -struct snd_vx_hardware *hw; +const struct snd_vx_hardware *hw;struct snd_vx222 *vx;int err;
sound/pci/vx222/vx222.h +2 -2
@@ -31,8 +31,8 @@ struct snd_vx222 {/* we use a lookup table with 148 values, see vx_mixer.c */ #define VX2_AKM_LEVEL_MAX 0x93 -extern struct snd_vx_ops vx222_ops; -extern struct snd_vx_ops vx222_old_ops; +extern const struct snd_vx_ops vx222_ops; +extern const struct snd_vx_ops vx222_old_ops;/* Offset of registers with base equal to portDSP. */ #define VX_RESET_DMA_REGISTER_OFFSET 0x00000008
sound/pci/vx222/vx222_ops.c +2 -2
@@ -984,7 +984,7 @@ static int vx2_add_mic_controls(struct vx_core *_chip)/* * callbacks */ -struct snd_vx_ops vx222_ops = { +const struct snd_vx_ops vx222_ops = { .in8 = vx2_inb, .in32 = vx2_inl, .out8 = vx2_outb,
@@ -1004,7 +1004,7 @@ struct snd_vx_ops vx222_ops = { };/* for old VX222 board */ -struct snd_vx_ops vx222_old_ops = { +const struct snd_vx_ops vx222_old_ops = { .in8 = vx2_inb, .in32 = vx2_inl, .out8 = vx2_outb,
sound/pcmcia/vx/vxp_ops.c +1 -1
@@ -581,7 +581,7 @@ static void vxp_reset_board(struct vx_core *_chip, int cold_reset)* callbacks */ /* exported */ -struct snd_vx_ops snd_vxpocket_ops = { +const struct snd_vx_ops snd_vxpocket_ops = { .in8 = vxp_inb, .out8 = vxp_outb, .test_and_ack = vxp_test_and_ack,
sound/pcmcia/vx/vxpocket.c +2 -2
@@ -82,7 +82,7 @@ static int snd_vxpocket_dev_free(struct snd_device *device) static const DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0); -static struct snd_vx_hardware vxpocket_hw = { +static const struct snd_vx_hardware vxpocket_hw = { .name ="VXPocket" , .type =VX_TYPE_VXPOCKET ,
@@ -104,7 +104,7 @@ static struct snd_vx_hardware vxpocket_hw = {* UER, but only for the first two inputs and outputs. */ -static struct snd_vx_hardware vxp440_hw = { +static const struct snd_vx_hardware vxp440_hw = { .name ="VXPocket440" , .type =VX_TYPE_VXP440 ,
sound/pcmcia/vx/vxpocket.h +1 -1
@@ -32,7 +32,7 @@ struct snd_vxpocket {#define to_vxpocket (x) container_of(x, struct snd_vxpocket, core) -extern struct snd_vx_ops snd_vxpocket_ops; +extern const struct snd_vx_ops snd_vxpocket_ops;void vx_set_mic_boost (struct vx_core *chip,int boost);void vx_set_mic_level (struct vx_core *chip,int level);
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 31/58 ALSA: mixer: oss: Constify snd_mixer_oss_assign_table definition
In reply to Takashi IwaiThe snd_mixer_oss_assign_table is read-only, and can it be declared as const.
There should be no functional changes by this patch.
--- sound/core/oss/mixer_oss.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
sound/core/oss/mixer_oss.c +8 -6
@@ -486,7 +486,7 @@ struct slot {unsigned int channels;unsigned int numid[SNDRV_MIXER_OSS_ITEM_COUNT ];unsigned int capture_item; -struct snd_mixer_oss_assign_table *assigned; +const struct snd_mixer_oss_assign_table *assigned; unsigned int allocated: 1; };
@@ -934,8 +934,8 @@ static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn)struct slot *p = chn->private_data;if (p) {if (p->allocated && p->assigned) { -kfree (p->assigned->name); -kfree (p->assigned); +kfree_const (p->assigned->name); +kfree_const (p->assigned); }kfree (p); }
@@ -953,7 +953,7 @@ static void mixer_slot_clear(struct snd_mixer_oss_slot *rslot)/* In a separate function to keep gcc 3.2 happy - do NOT merge this in snd_mixer_oss_build_input! */ static int snd_mixer_oss_build_test_all (struct snd_mixer_oss *mixer, -struct snd_mixer_oss_assign_table *ptr, +const struct snd_mixer_oss_assign_table *ptr,struct slot *slot) {char str[64 ];
@@ -1017,7 +1017,9 @@ static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer,* ptr_allocated means the entry is dynamically allocated (change via proc file). * when replace_old = 1, the old entry is replaced with the new one. */ -static int snd_mixer_oss_build_input (struct snd_mixer_oss *mixer,struct snd_mixer_oss_assign_table *ptr,int ptr_allocated,int replace_old) +static int snd_mixer_oss_build_input (struct snd_mixer_oss *mixer, +const struct snd_mixer_oss_assign_table *ptr, +int ptr_allocated,int replace_old) {struct slot slot;struct slot *pslot;
@@ -1255,7 +1257,7 @@ static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer)static void snd_mixer_oss_build (struct snd_mixer_oss *mixer) { -static struct snd_mixer_oss_assign_table table[] = { +static const struct snd_mixer_oss_assign_table table[] = { {SOUND_MIXER_VOLUME ,"Master" ,0 }, {SOUND_MIXER_VOLUME ,"Front" ,0 },/* fallback */ {SOUND_MIXER_BASS ,"Tone Control - Bass" ,0 },
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 32/58 ALSA: aoa: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/aoa/codecs/onyx.c | 2 +- sound/aoa/codecs/tas.c | 2 +- sound/aoa/fabrics/layout.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/aoa/codecs/onyx.c +1 -1
@@ -413,7 +413,7 @@ static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol, }#define SINGLE_BIT (n, type, description, address, mask, flags) \ -static struct snd_kcontrol_new n##_control = { \ +static const struct snd_kcontrol_new n##_control = { \ .iface = SNDRV_CTL_ELEM_IFACE_##type, \ .name = description, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
sound/aoa/codecs/tas.c +1 -1
@@ -369,7 +369,7 @@ static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol, }#define MIXER_CONTROL (n,descr,idx) \ -static struct snd_kcontrol_new n##_control = { \ +static const struct snd_kcontrol_new n##_control = { \ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ .name = descr " Playback Volume", \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \
sound/aoa/fabrics/layout.c +1 -1
@@ -655,7 +655,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol, \ !!ucontrol->value.integer.value[0]); \return 1 ; \ } \ -static struct snd_kcontrol_new n##_ctl = { \ +static const struct snd_kcontrol_new n##_ctl = { \ .iface =SNDRV_CTL_ELEM_IFACE_MIXER , \ .name = description, \ .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , \
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 33/58 ALSA: drivers: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization. Constify snd_kcontrol_new items
There should be no functional changes by this patch.
--- sound/drivers/aloop.c | 2 +- sound/drivers/dummy.c | 2 +- sound/drivers/mts64.c | 14 +++++++------- sound/drivers/opl4/opl4_mixer.c | 2 +- sound/drivers/pcsp/pcsp_mixer.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-)
sound/drivers/aloop.c +1 -1
@@ -1496,7 +1496,7 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new loopback_controls[] = { +static const struct snd_kcontrol_new loopback_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name ="PCM Rate Shift 100000" ,
sound/drivers/dummy.c +1 -1
@@ -849,7 +849,7 @@ static int snd_dummy_iobox_put(struct snd_kcontrol *kcontrol,return changed; } -static struct snd_kcontrol_new snd_dummy_controls[] = { +static const struct snd_kcontrol_new snd_dummy_controls[] = {DUMMY_VOLUME ("Master Volume" ,0 ,MIXER_ADDR_MASTER ),DUMMY_CAPSRC ("Master Capture Switch" ,0 ,MIXER_ADDR_MASTER ),DUMMY_VOLUME ("Synth Volume" ,0 ,MIXER_ADDR_SYNTH ),
sound/drivers/mts64.c +7 -7
@@ -467,7 +467,7 @@ static int snd_mts64_ctl_smpte_switch_put(struct snd_kcontrol* kctl,return changed; } -static struct snd_kcontrol_new mts64_ctl_smpte_switch = { +static const struct snd_kcontrol_new mts64_ctl_smpte_switch = { .iface =SNDRV_CTL_ELEM_IFACE_RAWMIDI , .name ="SMPTE Playback Switch" , .index =0 ,
@@ -540,7 +540,7 @@ static int snd_mts64_ctl_smpte_time_put(struct snd_kcontrol *kctl,return changed; } -static struct snd_kcontrol_new mts64_ctl_smpte_time_hours = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_hours = { .iface =SNDRV_CTL_ELEM_IFACE_RAWMIDI , .name ="SMPTE Time Hours" , .index =0 ,
@@ -551,7 +551,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_hours = { .put = snd_mts64_ctl_smpte_time_put }; -static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = { .iface =SNDRV_CTL_ELEM_IFACE_RAWMIDI , .name ="SMPTE Time Minutes" , .index =0 ,
@@ -562,7 +562,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = { .put = snd_mts64_ctl_smpte_time_put }; -static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = { .iface =SNDRV_CTL_ELEM_IFACE_RAWMIDI , .name ="SMPTE Time Seconds" , .index =0 ,
@@ -573,7 +573,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = { .put = snd_mts64_ctl_smpte_time_put }; -static struct snd_kcontrol_new mts64_ctl_smpte_time_frames = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_frames = { .iface =SNDRV_CTL_ELEM_IFACE_RAWMIDI , .name ="SMPTE Time Frames" , .index =0 ,
@@ -625,7 +625,7 @@ static int snd_mts64_ctl_smpte_fps_put(struct snd_kcontrol *kctl,return changed; } -static struct snd_kcontrol_new mts64_ctl_smpte_fps = { +static const struct snd_kcontrol_new mts64_ctl_smpte_fps = { .iface =SNDRV_CTL_ELEM_IFACE_RAWMIDI , .name ="SMPTE Fps" , .index =0 ,
@@ -641,7 +641,7 @@ static int snd_mts64_ctl_create(struct snd_card *card, struct mts64 *mts) {int err, i; -static struct snd_kcontrol_new *control[] = { +static const struct snd_kcontrol_new *control[] = { &mts64_ctl_smpte_switch, &mts64_ctl_smpte_time_hours, &mts64_ctl_smpte_time_minutes,
sound/drivers/opl4/opl4_mixer.c +1 -1
@@ -47,7 +47,7 @@ static int snd_opl4_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_vreturn value != old_value; } -static struct snd_kcontrol_new snd_opl4_controls[] = { +static const struct snd_kcontrol_new snd_opl4_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="FM Playback Volume" ,
sound/drivers/pcsp/pcsp_mixer.c +3 -3
@@ -120,17 +120,17 @@ static int pcsp_pcspkr_put(struct snd_kcontrol *kcontrol, .put = pcsp_##ctl_type##_put, \ } -static struct snd_kcontrol_new snd_pcsp_controls_pcm[] = { +static const struct snd_kcontrol_new snd_pcsp_controls_pcm[] = {PCSP_MIXER_CONTROL (enable,"Master Playback Switch" ),PCSP_MIXER_CONTROL (treble,"BaseFRQ Playback Volume" ), }; -static struct snd_kcontrol_new snd_pcsp_controls_spkr[] = { +static const struct snd_kcontrol_new snd_pcsp_controls_spkr[] = {PCSP_MIXER_CONTROL (pcspkr,"Beep Playback Switch" ), };static int snd_pcsp_ctls_add (struct snd_pcsp *chip, -struct snd_kcontrol_new *ctls,int num) +const struct snd_kcontrol_new *ctls,int num) {int i, err;struct snd_card *card = chip->card;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 34/58 ALSA: i2c: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/i2c/cs8427.c | 2 +- sound/i2c/other/ak4113.c | 2 +- sound/i2c/other/ak4114.c | 2 +- sound/i2c/other/ak4117.c | 2 +- sound/i2c/tea6330t.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)
sound/i2c/cs8427.c +1 -1
@@ -459,7 +459,7 @@ static int snd_cs8427_spdif_mask_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { +static const struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .info = snd_cs8427_in_status_info,
sound/i2c/other/ak4113.c +1 -1
@@ -349,7 +349,7 @@ static int snd_ak4113_spdif_qget(struct snd_kcontrol *kcontrol, }/* Don't forget to change AK4113_CONTROLS define!!! */ -static struct snd_kcontrol_new snd_ak4113_iec958_controls[] = { +static const struct snd_kcontrol_new snd_ak4113_iec958_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name ="IEC958 Parity Errors" ,
sound/i2c/other/ak4114.c +1 -1
@@ -318,7 +318,7 @@ static int snd_ak4114_spdif_qget(struct snd_kcontrol *kcontrol, }/* Don't forget to change AK4114_CONTROLS define!!! */ -static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { +static const struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name ="IEC958 Parity Errors" ,
sound/i2c/other/ak4117.c +1 -1
@@ -305,7 +305,7 @@ static int snd_ak4117_spdif_qget(struct snd_kcontrol *kcontrol, }/* Don't forget to change AK4117_CONTROLS define!!! */ -static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { +static const struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name ="IEC958 Parity Errors" ,
sound/i2c/tea6330t.c +2 -2
@@ -260,7 +260,7 @@ static int snd_tea6330t_put_treble(struct snd_kcontrol *kcontrol,return change; } -static struct snd_kcontrol_new snd_tea6330t_controls[] = { +static const struct snd_kcontrol_new snd_tea6330t_controls[] = {TEA6330T_MASTER_SWITCH ("Master Playback Switch" ,0 ),TEA6330T_MASTER_VOLUME ("Master Playback Volume" ,0 ),TEA6330T_BASS ("Tone Control - Bass" ,0 ),
@@ -278,7 +278,7 @@ int snd_tea6330t_update_mixer(struct snd_card *card, {struct snd_i2c_device *device;struct tea6330t *tea; -struct snd_kcontrol_new *knew; +const struct snd_kcontrol_new *knew;unsigned int idx;int err = -ENOMEM ;u8 default_treble, default_bass;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 35/58 ALSA: isa: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/isa/ad1816a/ad1816a_lib.c | 2 +- sound/isa/cmi8330.c | 2 +- sound/isa/cs423x/cs4236_lib.c | 14 +++++++------- sound/isa/es1688/es1688_lib.c | 2 +- sound/isa/es18xx.c | 26 +++++++++++++------------- sound/isa/gus/gus_mixer.c | 4 ++-- sound/isa/msnd/msnd_pinnacle_mixer.c | 2 +- sound/isa/opl3sa2.c | 4 ++-- sound/isa/opti9xx/miro.c | 14 +++++++------- sound/isa/opti9xx/opti92x-ad1848.c | 2 +- sound/isa/sb/emu8000.c | 14 +++++++------- sound/isa/sb/sb_mixer.c | 2 +- sound/isa/wss/wss_lib.c | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-)
sound/isa/ad1816a/ad1816a_lib.c +1 -1
@@ -884,7 +884,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); -static struct snd_kcontrol_new snd_ad1816a_controls[] = { +static const struct snd_kcontrol_new snd_ad1816a_controls[] = {AD1816A_DOUBLE ("Master Playback Switch" ,AD1816A_MASTER_ATT ,15 ,7 ,1 ,1 ),AD1816A_DOUBLE_TLV ("Master Playback Volume" ,AD1816A_MASTER_ATT ,8 ,0 ,31 ,1 , db_scale_5bit),
sound/isa/cmi8330.c +1 -1
@@ -179,7 +179,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_cmi8330_pnpids);#endif -static struct snd_kcontrol_new snd_cmi8330_controls[] = { +static const struct snd_kcontrol_new snd_cmi8330_controls[] = {WSS_DOUBLE ("Master Playback Volume" ,0 ,CMI8330_MASTVOL ,CMI8330_MASTVOL ,4 ,0 ,15 ,0 ), WSS_SINGLE("Loud Playback Switch", 0,
sound/isa/cs423x/cs4236_lib.c +7 -7
@@ -758,7 +758,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0); static const DECLARE_TLV_DB_SCALE(db_scale_2bit, -1800, 600, 0); static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); -static struct snd_kcontrol_new snd_cs4236_controls[] = { +static const struct snd_kcontrol_new snd_cs4236_controls[] = {CS4236_DOUBLE ("Master Digital Playback Switch" ,0 ,CS4236_LEFT_MASTER ,CS4236_RIGHT_MASTER ,7 ,7 ,1 ,1 ),
@@ -853,7 +853,7 @@ CS4236_DOUBLE1_TLV("Loopback Digital Playback Volume", 0, static const DECLARE_TLV_DB_SCALE(db_scale_5bit_6db_max, -5600, 200, 0); static const DECLARE_TLV_DB_SCALE(db_scale_2bit_16db_max, -2400, 800, 0); -static struct snd_kcontrol_new snd_cs4235_controls[] = { +static const struct snd_kcontrol_new snd_cs4235_controls[] = {WSS_DOUBLE ("Master Playback Switch" ,0 ,CS4235_LEFT_MASTER ,CS4235_RIGHT_MASTER ,7 ,7 ,1 ,1 ),
@@ -986,7 +986,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct snreturn change; } -static struct snd_kcontrol_new snd_cs4236_iec958_controls[] = { +static const struct snd_kcontrol_new snd_cs4236_iec958_controls[] = {CS4236_IEC958_ENABLE ("IEC958 Output Enable" ,0 ),CS4236_SINGLEC ("IEC958 Output Validity" ,0 ,4 ,4 ,1 ,0 ),CS4236_SINGLEC ("IEC958 Output User" ,0 ,4 ,5 ,1 ,0 ),
@@ -995,12 +995,12 @@ CS4236_SINGLEC("IEC958 Output Channel Status Low", 0, 5, 1, 127, 0),CS4236_SINGLEC ("IEC958 Output Channel Status High" ,0 ,6 ,0 ,255 ,0 ) }; -static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = { +static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = {CS4236_SINGLEC ("3D Control - Switch" ,0 ,3 ,4 ,1 ,0 ),CS4236_SINGLEC ("3D Control - Space" ,0 ,2 ,4 ,15 ,1 ) }; -static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = { +static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = {CS4236_SINGLEC ("3D Control - Switch" ,0 ,3 ,7 ,1 ,0 ),CS4236_SINGLEC ("3D Control - Space" ,0 ,2 ,4 ,15 ,1 ),CS4236_SINGLEC ("3D Control - Center" ,0 ,2 ,0 ,15 ,1 ),
@@ -1008,7 +1008,7 @@ CS4236_SINGLEC("3D Control - Mono", 0, 3, 6, 1, 0),CS4236_SINGLEC ("3D Control - IEC958" ,0 ,3 ,5 ,1 ,0 ) }; -static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = { +static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = {CS4236_SINGLEC ("3D Control - Switch" ,0 ,3 ,4 ,1 ,0 ),CS4236_SINGLEC ("3D Control - Space" ,0 ,2 ,4 ,15 ,1 ),CS4236_SINGLEC ("3D Control - Volume" ,0 ,2 ,0 ,15 ,1 ),
@@ -1020,7 +1020,7 @@ int snd_cs4236_mixer(struct snd_wss *chip)struct snd_card *card;unsigned int idx, count;int err; -struct snd_kcontrol_new *kcontrol; +const struct snd_kcontrol_new *kcontrol;if (snd_BUG_ON (!chip || !chip->card))return -EINVAL ;
sound/isa/es1688/es1688_lib.c +1 -1
@@ -924,7 +924,7 @@ static int snd_es1688_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_ereturn change; } -static struct snd_kcontrol_new snd_es1688_controls[] = { +static const struct snd_kcontrol_new snd_es1688_controls[] = {ES1688_DOUBLE ("Master Playback Volume" ,0 ,ES1688_MASTER_DEV ,ES1688_MASTER_DEV ,4 ,0 ,15 ,0 ),ES1688_DOUBLE ("PCM Playback Volume" ,0 ,ES1688_PCM_DEV ,ES1688_PCM_DEV ,4 ,0 ,15 ,0 ),ES1688_DOUBLE ("Line Playback Volume" ,0 ,ES1688_LINE_DEV ,ES1688_LINE_DEV ,4 ,0 ,15 ,0 ),
sound/isa/es18xx.c +13 -13
@@ -1246,7 +1246,7 @@ static int snd_es18xx_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e* The controls that are universal to all chipsets are fully initialized * here. */ -static struct snd_kcontrol_new snd_es18xx_base_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_base_controls[] = {ES18XX_DOUBLE ("Master Playback Volume" ,0 ,0x60 ,0x62 ,0 ,0 ,63 ,0 ),ES18XX_DOUBLE ("Master Playback Switch" ,0 ,0x60 ,0x62 ,6 ,6 ,1 ,1 ),ES18XX_DOUBLE ("Line Playback Volume" ,0 ,0x3e ,0x3e ,4 ,0 ,15 ,0 ),
@@ -1265,7 +1265,7 @@ ES18XX_DOUBLE("Capture Volume", 0, 0xb4, 0xb4, 4, 0, 15, 0), } }; -static struct snd_kcontrol_new snd_es18xx_recmix_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_recmix_controls[] = {ES18XX_DOUBLE ("PCM Capture Volume" ,0 ,0x69 ,0x69 ,4 ,0 ,15 ,0 ),ES18XX_DOUBLE ("Mic Capture Volume" ,0 ,0x68 ,0x68 ,4 ,0 ,15 ,0 ),ES18XX_DOUBLE ("Line Capture Volume" ,0 ,0x6e ,0x6e ,4 ,0 ,15 ,0 ),
@@ -1277,35 +1277,35 @@ ES18XX_DOUBLE("Aux Capture Volume", 0, 0x6c, 0x6c, 4, 0, 15, 0)/* * The chipset specific mixer controls */ -static struct snd_kcontrol_new snd_es18xx_opt_speaker = +static const struct snd_kcontrol_new snd_es18xx_opt_speaker =ES18XX_SINGLE ("Beep Playback Volume" ,0 ,0x3c ,0 ,7 ,0 ); -static struct snd_kcontrol_new snd_es18xx_opt_1869[] = { +static const struct snd_kcontrol_new snd_es18xx_opt_1869[] = {ES18XX_SINGLE ("Capture Switch" ,0 ,0x1c ,4 ,1 ,ES18XX_FL_INVERT ),ES18XX_SINGLE ("Video Playback Switch" ,0 ,0x7f ,0 ,1 ,0 ),ES18XX_DOUBLE ("Mono Playback Volume" ,0 ,0x6d ,0x6d ,4 ,0 ,15 ,0 ),ES18XX_DOUBLE ("Mono Capture Volume" ,0 ,0x6f ,0x6f ,4 ,0 ,15 ,0 ) }; -static struct snd_kcontrol_new snd_es18xx_opt_1878 = +static const struct snd_kcontrol_new snd_es18xx_opt_1878 =ES18XX_DOUBLE ("Video Playback Volume" ,0 ,0x68 ,0x68 ,4 ,0 ,15 ,0 ); -static struct snd_kcontrol_new snd_es18xx_opt_1879[] = { +static const struct snd_kcontrol_new snd_es18xx_opt_1879[] = {ES18XX_SINGLE ("Video Playback Switch" ,0 ,0x71 ,6 ,1 ,0 ),ES18XX_DOUBLE ("Video Playback Volume" ,0 ,0x6d ,0x6d ,4 ,0 ,15 ,0 ),ES18XX_DOUBLE ("Video Capture Volume" ,0 ,0x6f ,0x6f ,4 ,0 ,15 ,0 ) }; -static struct snd_kcontrol_new snd_es18xx_pcm1_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_pcm1_controls[] = {ES18XX_DOUBLE ("PCM Playback Volume" ,0 ,0x14 ,0x14 ,4 ,0 ,15 ,0 ), }; -static struct snd_kcontrol_new snd_es18xx_pcm2_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_pcm2_controls[] = {ES18XX_DOUBLE ("PCM Playback Volume" ,0 ,0x7c ,0x7c ,4 ,0 ,15 ,0 ),ES18XX_DOUBLE ("PCM Playback Volume" ,1 ,0x14 ,0x14 ,4 ,0 ,15 ,0 ) }; -static struct snd_kcontrol_new snd_es18xx_spatializer_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_spatializer_controls[] = {ES18XX_SINGLE ("3D Control - Level" ,0 ,0x52 ,0 ,63 ,0 ), { .iface =SNDRV_CTL_ELEM_IFACE_MIXER ,
@@ -1316,13 +1316,13 @@ ES18XX_SINGLE("3D Control - Level", 0, 0x52, 0, 63, 0), } }; -static struct snd_kcontrol_new snd_es18xx_micpre1_control = +static const struct snd_kcontrol_new snd_es18xx_micpre1_control =ES18XX_SINGLE ("Mic Boost (+26dB)" ,0 ,0xa9 ,2 ,1 ,0 ); -static struct snd_kcontrol_new snd_es18xx_micpre2_control = +static const struct snd_kcontrol_new snd_es18xx_micpre2_control =ES18XX_SINGLE ("Mic Boost (+26dB)" ,0 ,0x7d ,3 ,1 ,0 ); -static struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Hardware Master Playback Volume" ,
@@ -1340,7 +1340,7 @@ static struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { ES18XX_SINGLE("Hardware Master Volume Split", 0, 0x64, 7, 1, 0), }; -static struct snd_kcontrol_new snd_es18xx_opt_gpo_2bit[] = { +static const struct snd_kcontrol_new snd_es18xx_opt_gpo_2bit[] = {ES18XX_SINGLE ("GPO0 Switch" ,0 ,ES18XX_PM ,0 ,1 ,ES18XX_FL_PMPORT ),ES18XX_SINGLE ("GPO1 Switch" ,0 ,ES18XX_PM ,1 ,1 ,ES18XX_FL_PMPORT ), };
sound/isa/gus/gus_mixer.c +2 -2
@@ -120,13 +120,13 @@ static int snd_ics_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elemreturn change; } -static struct snd_kcontrol_new snd_gf1_controls[] = { +static const struct snd_kcontrol_new snd_gf1_controls[] = {GF1_SINGLE ("Master Playback Switch" ,0 ,1 ,1 ),GF1_SINGLE ("Line Switch" ,0 ,0 ,1 ),GF1_SINGLE ("Mic Switch" ,0 ,2 ,0 ) }; -static struct snd_kcontrol_new snd_ics_controls[] = { +static const struct snd_kcontrol_new snd_ics_controls[] = {GF1_SINGLE ("Master Playback Switch" ,0 ,1 ,1 ),ICS_DOUBLE ("Master Playback Volume" ,0 ,SNDRV_ICS_MASTER_DEV ),ICS_DOUBLE ("Synth Playback Volume" ,0 ,SNDRV_ICS_GF1_DEV ),
sound/isa/msnd/msnd_pinnacle_mixer.c +1 -1
@@ -275,7 +275,7 @@ static int snd_msndmix_volume_put(struct snd_kcontrol *kcontrol, .private_value = addr } -static struct snd_kcontrol_new snd_msnd_controls[] = { +static const struct snd_kcontrol_new snd_msnd_controls[] = {DUMMY_VOLUME ("Master Volume" ,0 ,MSND_MIXER_VOLUME ),DUMMY_VOLUME ("PCM Volume" ,0 ,MSND_MIXER_PCM ),DUMMY_VOLUME ("Aux Volume" ,0 ,MSND_MIXER_AUX ),
sound/isa/opl3sa2.c +2 -2
@@ -457,7 +457,7 @@ static int snd_opl3sa2_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_ static const DECLARE_TLV_DB_SCALE(db_scale_master, -3000, 200, 0); static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); -static struct snd_kcontrol_new snd_opl3sa2_controls[] = { +static const struct snd_kcontrol_new snd_opl3sa2_controls[] = {OPL3SA2_DOUBLE ("Master Playback Switch" ,0 ,0x07 ,0x08 ,7 ,7 ,1 ,1 ),OPL3SA2_DOUBLE_TLV ("Master Playback Volume" ,0 ,0x07 ,0x08 ,0 ,0 ,15 ,1 , db_scale_master),
@@ -467,7 +467,7 @@ OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0), }; -static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { +static const struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = {OPL3SA2_DOUBLE ("3D Control - Wide" ,0 ,0x14 ,0x14 ,4 ,0 ,7 ,0 ),OPL3SA2_DOUBLE ("Tone Control - Bass" ,0 ,0x15 ,0x15 ,4 ,0 ,7 ,0 ),OPL3SA2_DOUBLE ("Tone Control - Treble" ,0 ,0x16 ,0x16 ,4 ,0 ,7 ,0 )
sound/isa/opti9xx/miro.c +7 -7
@@ -577,7 +577,7 @@ static int snd_miro_put_double(struct snd_kcontrol *kcontrol,return change; } -static struct snd_kcontrol_new snd_miro_controls[] = { +static const struct snd_kcontrol_new snd_miro_controls[] = {MIRO_DOUBLE ("Master Playback Volume" ,0 ,ACI_GET_MASTER ,ACI_SET_MASTER ),MIRO_DOUBLE ("Mic Playback Volume" ,1 ,ACI_GET_MIC ,ACI_SET_MIC ),MIRO_DOUBLE ("Line Playback Volume" ,1 ,ACI_GET_LINE ,ACI_SET_LINE ),
@@ -589,7 +589,7 @@ MIRO_DOUBLE("Aux Playback Volume", 2, ACI_GET_LINE2, ACI_SET_LINE2),/* Equalizer with seven bands (only PCM20) from -12dB up to +12dB on each band */ -static struct snd_kcontrol_new snd_miro_eq_controls[] = { +static const struct snd_kcontrol_new snd_miro_eq_controls[] = {MIRO_DOUBLE ("Tone Control - 28 Hz" ,0 ,ACI_GET_EQ1 ,ACI_SET_EQ1 ),MIRO_DOUBLE ("Tone Control - 160 Hz" ,0 ,ACI_GET_EQ2 ,ACI_SET_EQ2 ),MIRO_DOUBLE ("Tone Control - 400 Hz" ,0 ,ACI_GET_EQ3 ,ACI_SET_EQ3 ),
@@ -599,15 +599,15 @@ MIRO_DOUBLE("Tone Control - 6.3 kHz", 0, ACI_GET_EQ6, ACI_SET_EQ6), MIRO_DOUBLE("Tone Control - 16 kHz", 0, ACI_GET_EQ7, ACI_SET_EQ7), }; -static struct snd_kcontrol_new snd_miro_radio_control[] = { +static const struct snd_kcontrol_new snd_miro_radio_control[] = {MIRO_DOUBLE ("Radio Playback Volume" ,0 ,ACI_GET_LINE1 ,ACI_SET_LINE1 ), }; -static struct snd_kcontrol_new snd_miro_line_control[] = { +static const struct snd_kcontrol_new snd_miro_line_control[] = {MIRO_DOUBLE ("Line Playback Volume" ,2 ,ACI_GET_LINE1 ,ACI_SET_LINE1 ), }; -static struct snd_kcontrol_new snd_miro_preamp_control[] = { +static const struct snd_kcontrol_new snd_miro_preamp_control[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Mic Boost" ,
@@ -617,7 +617,7 @@ static struct snd_kcontrol_new snd_miro_preamp_control[] = { .put = snd_miro_put_preamp, }}; -static struct snd_kcontrol_new snd_miro_amp_control[] = { +static const struct snd_kcontrol_new snd_miro_amp_control[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Line Boost" ,
@@ -627,7 +627,7 @@ static struct snd_kcontrol_new snd_miro_amp_control[] = { .put = snd_miro_put_amp, }}; -static struct snd_kcontrol_new snd_miro_capture_control[] = { +static const struct snd_kcontrol_new snd_miro_capture_control[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="PCM Capture Switch" ,
sound/isa/opti9xx/opti92x-ad1848.c +1 -1
@@ -550,7 +550,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_step, -9300, 300, 0); static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_4bit_12db_max, -3300, 300, 0); -static struct snd_kcontrol_new snd_opti93x_controls[] = { +static const struct snd_kcontrol_new snd_opti93x_controls[] = {WSS_DOUBLE ("Master Playback Switch" ,0 , OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT,7 ,7 ,1 ,1 ), WSS_DOUBLE_TLV("Master Playback Volume", 0,
sound/isa/sb/emu8000.c +7 -7
@@ -855,7 +855,7 @@ static int mixer_bass_treble_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ereturn change; } -static struct snd_kcontrol_new mixer_bass_control = +static const struct snd_kcontrol_new mixer_bass_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Synth Tone Control - Bass" ,
@@ -865,7 +865,7 @@ static struct snd_kcontrol_new mixer_bass_control = .private_value = 0, }; -static struct snd_kcontrol_new mixer_treble_control = +static const struct snd_kcontrol_new mixer_treble_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Synth Tone Control - Treble" ,
@@ -922,7 +922,7 @@ static int mixer_chorus_reverb_put(struct snd_kcontrol *kcontrol, struct snd_ctlreturn change; } -static struct snd_kcontrol_new mixer_chorus_mode_control = +static const struct snd_kcontrol_new mixer_chorus_mode_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Chorus Mode" ,
@@ -932,7 +932,7 @@ static struct snd_kcontrol_new mixer_chorus_mode_control = .private_value = 1, }; -static struct snd_kcontrol_new mixer_reverb_mode_control = +static const struct snd_kcontrol_new mixer_reverb_mode_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Reverb Mode" ,
@@ -984,7 +984,7 @@ static int mixer_fm_depth_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elemreturn change; } -static struct snd_kcontrol_new mixer_fm_chorus_depth_control = +static const struct snd_kcontrol_new mixer_fm_chorus_depth_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="FM Chorus Depth" ,
@@ -994,7 +994,7 @@ static struct snd_kcontrol_new mixer_fm_chorus_depth_control = .private_value = 1, }; -static struct snd_kcontrol_new mixer_fm_reverb_depth_control = +static const struct snd_kcontrol_new mixer_fm_reverb_depth_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="FM Reverb Depth" ,
@@ -1005,7 +1005,7 @@ static struct snd_kcontrol_new mixer_fm_reverb_depth_control = }; -static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS ] = { +static const struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS ] = { &mixer_bass_control, &mixer_treble_control, &mixer_chorus_mode_control,
sound/isa/sb/sb_mixer.c +1 -1
@@ -438,7 +438,7 @@ static int snd_sb16mixer_put_input_sw(struct snd_kcontrol *kcontrol, struct snd_*/ int snd_sbmixer_add_ctl (struct snd_sb *chip,const char *name,int index,int type,unsigned long value) { -static struct snd_kcontrol_new newctls[] = { +static const struct snd_kcontrol_new newctls[] = { [SB_MIX_SINGLE ] = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .info = snd_sbmixer_info_single,
sound/isa/wss/wss_lib.c +1 -1
@@ -2157,7 +2157,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0); -static struct snd_kcontrol_new snd_wss_controls[] = { +static const struct snd_kcontrol_new snd_wss_controls[] = {WSS_DOUBLE ("PCM Playback Switch" ,0 ,CS4231_LEFT_OUTPUT ,CS4231_RIGHT_OUTPUT ,7 ,7 ,1 ,1 ), WSS_DOUBLE_TLV("PCM Playback Volume", 0,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 36/58 ALSA: hda: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/pci/hda/hda_codec.c | 8 ++++---- sound/pci/hda/patch_sigmatel.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-)
sound/pci/hda/hda_codec.c +4 -4
@@ -2387,7 +2387,7 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,return change; } -static struct snd_kcontrol_new dig_mixes[] = { +static const struct snd_kcontrol_new dig_mixes[] = { { .access =SNDRV_CTL_ELEM_ACCESS_READ , .iface =SNDRV_CTL_ELEM_IFACE_MIXER ,
@@ -2437,7 +2437,7 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, {int err;struct snd_kcontrol *kctl; -struct snd_kcontrol_new *dig_mix; +const struct snd_kcontrol_new *dig_mix;int idx =0 ;int val =0 ;const int spdif_index =16 ;
@@ -2655,7 +2655,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new dig_in_ctls[] = { +static const struct snd_kcontrol_new dig_in_ctls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name =SNDRV_CTL_NAME_IEC958 ("" ,CAPTURE ,SWITCH ),
@@ -2687,7 +2687,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) {int err;struct snd_kcontrol *kctl; -struct snd_kcontrol_new *dig_mix; +const struct snd_kcontrol_new *dig_mix;int idx; idx =find_empty_mixer_ctl_idx (codec,"IEC958 Capture Switch" ,0 );
sound/pci/hda/patch_sigmatel.c +3 -3
@@ -825,11 +825,11 @@ static int stac_auto_create_beep_ctls(struct hda_codec *codec,struct sigmatel_spec *spec = codec->spec;u32 caps =query_amp_caps (codec, nid,HDA_OUTPUT );struct snd_kcontrol_new *knew; -static struct snd_kcontrol_new abeep_mute_ctl = +static const struct snd_kcontrol_new abeep_mute_ctl =HDA_CODEC_MUTE (NULL ,0 ,0 ,0 ); -static struct snd_kcontrol_new dbeep_mute_ctl = +static const struct snd_kcontrol_new dbeep_mute_ctl =HDA_CODEC_MUTE_BEEP (NULL ,0 ,0 ,0 ); -static struct snd_kcontrol_new beep_vol_ctl = +static const struct snd_kcontrol_new beep_vol_ctl =HDA_CODEC_VOLUME (NULL ,0 ,0 ,0 );/* check for mute support for the the amp */
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 37/58 ALSA: pci: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/pci/ak4531_codec.c | 2 +- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 2 +- sound/pci/azt3328.c | 2 +- sound/pci/ca0106/ca0106_mixer.c | 4 ++-- sound/pci/cmipci.c | 16 ++++++++-------- sound/pci/cs46xx/cs46xx_lib.c | 4 ++-- sound/pci/cs5535audio/cs5535audio_olpc.c | 2 +- sound/pci/emu10k1/emumixer.c | 14 +++++++------- sound/pci/emu10k1/p16v.c | 2 +- sound/pci/ens1370.c | 4 ++-- sound/pci/es1938.c | 2 +- sound/pci/fm801.c | 4 ++-- sound/pci/ice1712/aureon.c | 10 +++++----- sound/pci/ice1712/delta.c | 10 +++++----- sound/pci/ice1712/ews.c | 6 +++--- sound/pci/ice1712/ice1712.c | 2 +- sound/pci/ice1712/juli.c | 2 +- sound/pci/ice1712/maya44.c | 2 +- sound/pci/ice1712/phase.c | 4 ++-- sound/pci/ice1712/pontis.c | 2 +- sound/pci/ice1712/prodigy192.c | 4 ++-- sound/pci/ice1712/prodigy_hifi.c | 4 ++-- sound/pci/ice1712/quartet.c | 2 +- sound/pci/ice1712/wtm.c | 2 +- sound/pci/korg1212/korg1212.c | 2 +- sound/pci/rme32.c | 2 +- sound/pci/rme96.c | 2 +- sound/pci/rme9652/hdsp.c | 8 ++++---- sound/pci/rme9652/hdspm.c | 14 +++++++------- sound/pci/rme9652/rme9652.c | 6 +++--- sound/pci/sonicvibes.c | 6 +++--- sound/pci/ymfpci/ymfpci_main.c | 2 +- 33 files changed, 76 insertions(+), 76 deletions(-)
sound/pci/ak4531_codec.c +1 -1
@@ -255,7 +255,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_master, -6200, 200, 0); static const DECLARE_TLV_DB_SCALE(db_scale_mono, -2800, 400, 0); static const DECLARE_TLV_DB_SCALE(db_scale_input, -5000, 200, 0); -static struct snd_kcontrol_new snd_ak4531_controls[] = { +static const struct snd_kcontrol_new snd_ak4531_controls[] = { AK4531_DOUBLE_TLV("Master Playback Switch", 0, AK4531_LMASTER, AK4531_RMASTER, 7, 7, 1, 1,
sound/pci/ali5451/ali5451.c +1 -1
@@ -1776,7 +1776,7 @@ static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol,return change; } -static struct snd_kcontrol_new snd_ali5451_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_ali5451_mixer_spdif[] = {/* spdif aplayback switch */ /* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */ ALI5451_SPDIF (SNDRV_CTL_NAME_IEC958 ("Output " ,NONE ,SWITCH ),0 ,0 ),
sound/pci/au88x0/au88x0_pcm.c +1 -1
@@ -497,7 +497,7 @@ static int snd_vortex_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el }/* spdif controls */ -static struct snd_kcontrol_new snd_vortex_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_vortex_mixer_spdif[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name =SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,DEFAULT ),
sound/pci/azt3328.c +1 -1
@@ -1094,7 +1094,7 @@ snd_azf3328_put_mixer_enum(struct snd_kcontrol *kcontrol,return (nreg != oreg); } -static struct snd_kcontrol_new snd_azf3328_mixer_controls[] = { +static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] = {AZF3328_MIXER_SWITCH ("Master Playback Switch" ,IDX_MIXER_PLAY_MASTER ,15 ,1 ),AZF3328_MIXER_VOL_STEREO ("Master Playback Volume" ,IDX_MIXER_PLAY_MASTER ,0x1f ,1 ),AZF3328_MIXER_SWITCH ("PCM Playback Switch" ,IDX_MIXER_WAVEOUT ,15 ,1 ),
sound/pci/ca0106/ca0106_mixer.c +2 -2
@@ -550,7 +550,7 @@ static int spi_mute_put(struct snd_kcontrol *kcontrol, .private_value = ((chid) << 8) | (reg) \ } -static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = { +static const struct snd_kcontrol_new snd_ca0106_volume_ctls[] = {CA_VOLUME ("Analog Front Playback Volume" ,CONTROL_FRONT_CHANNEL ,PLAYBACK_VOLUME2 ), CA_VOLUME("Analog Rear Playback Volume",
@@ -631,7 +631,7 @@ static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = { .private_value = chid \ } -static struct snd_kcontrol_new snd_ca0106_volume_i2c_adc_ctls[] = { +static const struct snd_kcontrol_new snd_ca0106_volume_i2c_adc_ctls[] = {I2C_VOLUME ("Phone Capture Volume" ,0 ),I2C_VOLUME ("Mic Capture Volume" ,1 ),I2C_VOLUME ("Line in Capture Volume" ,2 ),
sound/pci/cmipci.c +8 -8
@@ -2256,7 +2256,7 @@ static int snd_cmipci_put_native_mixer_sensitive(struct snd_kcontrol *kcontrol, } -static struct snd_kcontrol_new snd_cmipci_mixers[] = { +static const struct snd_kcontrol_new snd_cmipci_mixers[] = {CMIPCI_SB_VOL_STEREO ("Master Playback Volume" ,SB_DSP4_MASTER_DEV ,3 ,31 ),CMIPCI_MIXER_SW_MONO ("3D Control - Switch" ,CM_REG_MIXER1 ,CM_X3DEN_SHIFT ,0 ),CMIPCI_SB_VOL_STEREO ("PCM Playback Volume" ,SB_DSP4_PCM_DEV ,3 ,31 ),
@@ -2567,7 +2567,7 @@ static int snd_cmipci_mic_in_mode_put(struct snd_kcontrol *kcontrol, }/* both for CM8338/8738 */ -static struct snd_kcontrol_new snd_cmipci_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_mixer_switches[] = {DEFINE_MIXER_SWITCH ("Four Channel Mode" , fourch), { .name ="Line-In Mode" ,
@@ -2579,11 +2579,11 @@ static struct snd_kcontrol_new snd_cmipci_mixer_switches[] = { };/* for non-multichannel chips */ -static struct snd_kcontrol_new snd_cmipci_nomulti_switch = +static const struct snd_kcontrol_new snd_cmipci_nomulti_switch =DEFINE_MIXER_SWITCH ("Exchange DAC" , exchange_dac);/* only for CM8738 */ -static struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] = { #if 0 /* controlled in pcm device */DEFINE_MIXER_SWITCH ("IEC958 In Record" , spdif_in), DEFINE_MIXER_SWITCH("IEC958 Out", spdif_out),
@@ -2605,14 +2605,14 @@ static struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] = { };/* only for model 033/037 */ -static struct snd_kcontrol_new snd_cmipci_old_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_old_mixer_switches[] = {DEFINE_MIXER_SWITCH ("IEC958 Mix Analog" , spdif_dac_out),DEFINE_MIXER_SWITCH ("IEC958 In Phase Inverse" , spdi_phase),DEFINE_MIXER_SWITCH ("IEC958 In Select" , spdif_in_sel1), };/* only for model 039 or later */ -static struct snd_kcontrol_new snd_cmipci_extra_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_extra_mixer_switches[] = {DEFINE_MIXER_SWITCH ("IEC958 In Select" , spdif_in_sel2),DEFINE_MIXER_SWITCH ("IEC958 In Phase Inverse" , spdi_phase2), {
@@ -2625,14 +2625,14 @@ static struct snd_kcontrol_new snd_cmipci_extra_mixer_switches[] = { };/* card control switches */ -static struct snd_kcontrol_new snd_cmipci_modem_switch = +static const struct snd_kcontrol_new snd_cmipci_modem_switch =DEFINE_CARD_SWITCH ("Modem" , modem);static int snd_cmipci_mixer_new (struct cmipci *cm,int pcm_spdif_device) {struct snd_card *card; -struct snd_kcontrol_new *sw; +const struct snd_kcontrol_new *sw;struct snd_kcontrol *kctl;unsigned int idx;int err;
sound/pci/cs46xx/cs46xx_lib.c +2 -2
@@ -2238,7 +2238,7 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,#endif /* CONFIG_SND_CS46XX_NEW_DSP */ -static struct snd_kcontrol_new snd_cs46xx_controls[] = { +static const struct snd_kcontrol_new snd_cs46xx_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="DAC Volume" ,
@@ -2364,7 +2364,7 @@ static const struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = { #ifdef CONFIG_SND_CS46XX_NEW_DSP /* Only available on the Hercules Game Theater XP soundcard */ -static struct snd_kcontrol_new snd_hercules_controls[] = { +static const struct snd_kcontrol_new snd_hercules_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Optical/Coaxial SPDIF Input Switch",
sound/pci/cs5535audio/cs5535audio_olpc.c +1 -1
@@ -111,7 +111,7 @@ static int olpc_mic_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v)return 1 ; } -static struct snd_kcontrol_new olpc_cs5535audio_ctls[] = { +static const struct snd_kcontrol_new olpc_cs5535audio_ctls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="DC Mode Enable" ,
sound/pci/emu10k1/emumixer.c +7 -7
@@ -484,7 +484,7 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol *kcontrol, .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = { +static const struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = {EMU1010_SOURCE_OUTPUT ("Dock DAC1 Left Playback Enum" ,0 ),EMU1010_SOURCE_OUTPUT ("Dock DAC1 Right Playback Enum" ,1 ),EMU1010_SOURCE_OUTPUT ("Dock DAC2 Left Playback Enum" ,2 ),
@@ -513,7 +513,7 @@ static struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = {/* 1616(m) cardbus */ -static struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { +static const struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = {EMU1010_SOURCE_OUTPUT ("Dock DAC1 Left Playback Enum" ,0 ),EMU1010_SOURCE_OUTPUT ("Dock DAC1 Right Playback Enum" ,1 ),EMU1010_SOURCE_OUTPUT ("Dock DAC2 Left Playback Enum" ,2 ),
@@ -545,7 +545,7 @@ static struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = { +static const struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = {EMU1010_SOURCE_INPUT ("DSP 0 Capture Enum" ,0 ),EMU1010_SOURCE_INPUT ("DSP 1 Capture Enum" ,1 ),EMU1010_SOURCE_INPUT ("DSP 2 Capture Enum" ,2 ),
@@ -613,7 +613,7 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_adc_pads[] = { +static const struct snd_kcontrol_new snd_emu1010_adc_pads[] = {EMU1010_ADC_PADS ("ADC1 14dB PAD Audio Dock Capture Switch" ,EMU_HANA_DOCK_ADC_PAD1 ),EMU1010_ADC_PADS ("ADC2 14dB PAD Audio Dock Capture Switch" ,EMU_HANA_DOCK_ADC_PAD2 ),EMU1010_ADC_PADS ("ADC3 14dB PAD Audio Dock Capture Switch" ,EMU_HANA_DOCK_ADC_PAD3 ),
@@ -661,7 +661,7 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_dac_pads[] = { +static const struct snd_kcontrol_new snd_emu1010_dac_pads[] = {EMU1010_DAC_PADS ("DAC1 Audio Dock 14dB PAD Playback Switch" ,EMU_HANA_DOCK_DAC_PAD1 ),EMU1010_DAC_PADS ("DAC2 Audio Dock 14dB PAD Playback Switch" ,EMU_HANA_DOCK_DAC_PAD2 ),EMU1010_DAC_PADS ("DAC3 Audio Dock 14dB PAD Playback Switch" ,EMU_HANA_DOCK_DAC_PAD3 ),
@@ -1051,7 +1051,7 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol, } -static struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { +static const struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = {I2C_VOLUME ("Mic Capture Volume" ,0 ),I2C_VOLUME ("Line Capture Volume" ,0 ) };
@@ -1125,7 +1125,7 @@ static int snd_audigy_spdif_output_rate_put(struct snd_kcontrol *kcontrol,return change; } -static struct snd_kcontrol_new snd_audigy_spdif_output_rate = +static const struct snd_kcontrol_new snd_audigy_spdif_output_rate = { .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .iface =SNDRV_CTL_ELEM_IFACE_MIXER ,
sound/pci/emu10k1/p16v.c +1 -1
@@ -776,7 +776,7 @@ static const DECLARE_TLV_DB_SCALE(snd_p16v_db_scale1, -5175, 25, 1); .private_value = ((xreg) | ((xhl) << 8)) \ } -static struct snd_kcontrol_new p16v_mixer_controls[] = { +static const struct snd_kcontrol_new p16v_mixer_controls[] = {P16V_VOL ("HD Analog Front Playback Volume" ,PLAYBACK_VOLUME_MIXER9 ,0 ),P16V_VOL ("HD Analog Rear Playback Volume" ,PLAYBACK_VOLUME_MIXER10 ,1 ),P16V_VOL ("HD Analog Center/LFE Playback Volume" ,PLAYBACK_VOLUME_MIXER9 ,1 ),
sound/pci/ens1370.c +2 -2
@@ -1433,7 +1433,7 @@ static int snd_es1371_spdif_put(struct snd_kcontrol *kcontrol,/* spdif controls */ -static struct snd_kcontrol_new snd_es1371_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_es1371_mixer_spdif[] = {ES1371_SPDIF (SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,SWITCH )), { .iface =SNDRV_CTL_ELEM_IFACE_PCM ,
@@ -1698,7 +1698,7 @@ static int snd_ensoniq_control_put(struct snd_kcontrol *kcontrol,* ENS1370 mixer */ -static struct snd_kcontrol_new snd_es1370_controls[2 ] = { +static const struct snd_kcontrol_new snd_es1370_controls[2 ] = {ENSONIQ_CONTROL ("PCM 0 Output also on Line-In Jack" ,ES_1370_XCTL0 ),ENSONIQ_CONTROL ("Mic +5V bias" ,ES_1370_XCTL1 ) };
sound/pci/es1938.c +1 -1
@@ -1307,7 +1307,7 @@ static const DECLARE_TLV_DB_RANGE(db_scale_line, static const DECLARE_TLV_DB_SCALE(db_scale_capture, 0, 150, 0); -static struct snd_kcontrol_new snd_es1938_controls[] = { +static const struct snd_kcontrol_new snd_es1938_controls[] = {ES1938_DOUBLE_TLV ("Master Playback Volume" ,0 ,0x60 ,0x62 ,0 ,0 ,63 ,0 , db_scale_master),ES1938_DOUBLE ("Master Playback Switch" ,0 ,0x60 ,0x62 ,6 ,6 ,1 ,1 ),
sound/pci/fm801.c +2 -2
@@ -969,7 +969,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_dsp, -3450, 150, 0);#define FM801_CONTROLS ARRAY_SIZE(snd_fm801_controls) -static struct snd_kcontrol_new snd_fm801_controls[] = { +static const struct snd_kcontrol_new snd_fm801_controls[] = {FM801_DOUBLE_TLV ("Wave Playback Volume" ,FM801_PCM_VOL ,0 ,8 ,31 ,1 , db_scale_dsp),FM801_SINGLE ("Wave Playback Switch" ,FM801_PCM_VOL ,15 ,1 ,1 ),
@@ -990,7 +990,7 @@ FM801_SINGLE("FM Playback Switch", FM801_FM_VOL, 15, 1, 1),#define FM801_CONTROLS_MULTI ARRAY_SIZE(snd_fm801_controls_multi) -static struct snd_kcontrol_new snd_fm801_controls_multi[] = { +static const struct snd_kcontrol_new snd_fm801_controls_multi[] = {FM801_SINGLE ("AC97 2ch->4ch Copy Switch" ,FM801_CODEC_CTRL ,7 ,1 ,0 ),FM801_SINGLE ("AC97 18-bit Switch" ,FM801_CODEC_CTRL ,10 ,1 ,0 ),FM801_SINGLE (SNDRV_CTL_NAME_IEC958 ("" ,CAPTURE ,SWITCH ),FM801_I2S_MODE ,8 ,1 ,0 ),
sound/pci/ice1712/aureon.c +5 -5
@@ -1389,7 +1389,7 @@ static int aureon_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ctl* mixers */ -static struct snd_kcontrol_new aureon_dac_controls[] = { +static const struct snd_kcontrol_new aureon_dac_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Switch" ,
@@ -1504,7 +1504,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] = { } }; -static struct snd_kcontrol_new wm_controls[] = { +static const struct snd_kcontrol_new wm_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="PCM Playback Switch" ,
@@ -1570,7 +1570,7 @@ static struct snd_kcontrol_new wm_controls[] = { } }; -static struct snd_kcontrol_new ac97_controls[] = { +static const struct snd_kcontrol_new ac97_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="AC97 Playback Switch" ,
@@ -1675,7 +1675,7 @@ static struct snd_kcontrol_new ac97_controls[] = { } }; -static struct snd_kcontrol_new universe_ac97_controls[] = { +static const struct snd_kcontrol_new universe_ac97_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="AC97 Playback Switch" ,
@@ -1807,7 +1807,7 @@ static struct snd_kcontrol_new universe_ac97_controls[] = { }; -static struct snd_kcontrol_new cs8415_controls[] = { +static const struct snd_kcontrol_new cs8415_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name =SNDRV_CTL_NAME_IEC958 ("" ,CAPTURE ,SWITCH ),
sound/pci/ice1712/delta.c +5 -5
@@ -753,15 +753,15 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice)* additional controls for M-Audio cards */ -static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select = +static const struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select =ICE1712_GPIO (SNDRV_CTL_ELEM_IFACE_MIXER ,"Word Clock Sync" ,0 ,ICE1712_DELTA_WORD_CLOCK_SELECT ,1 ,0 ); -static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select = +static const struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select =ICE1712_GPIO (SNDRV_CTL_ELEM_IFACE_MIXER ,"Word Clock Sync" ,0 ,ICE1712_DELTA_1010LT_WORDCLOCK ,0 ,0 ); -static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status = +static const struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status =ICE1712_GPIO (SNDRV_CTL_ELEM_IFACE_MIXER ,"Word Clock Status" ,0 ,ICE1712_DELTA_WORD_CLOCK_STATUS ,1 ,SNDRV_CTL_ELEM_ACCESS_READ |SNDRV_CTL_ELEM_ACCESS_VOLATILE ); -static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select = +static const struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select =ICE1712_GPIO (SNDRV_CTL_ELEM_IFACE_MIXER ,"IEC958 Input Optical" ,0 ,ICE1712_DELTA_SPDIF_INPUT_SELECT ,0 ,0 ); -static struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status = +static const struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status =ICE1712_GPIO (SNDRV_CTL_ELEM_IFACE_MIXER ,"Delta IEC958 Input Status" ,0 ,ICE1712_DELTA_SPDIF_IN_STAT ,1 ,SNDRV_CTL_ELEM_ACCESS_READ |SNDRV_CTL_ELEM_ACCESS_VOLATILE );
sound/pci/ice1712/ews.c +3 -3
@@ -597,7 +597,7 @@ static int snd_ice1712_ewx_io_sense_put(struct snd_kcontrol *kcontrol, struct snreturn val != nval; } -static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = { +static const struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Input Sensitivity Switch" ,
@@ -792,7 +792,7 @@ static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct .private_value = xshift | (xinvert << 8),\ } -static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = { +static const struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = {EWS88D_CONTROL (SNDRV_CTL_ELEM_IFACE_MIXER ,"IEC958 Input Optical" ,0 ,1 ,0 ),/* inverted */ EWS88D_CONTROL (SNDRV_CTL_ELEM_IFACE_MIXER ,"ADAT Output Optical" ,1 ,0 ,0 ),EWS88D_CONTROL (SNDRV_CTL_ELEM_IFACE_MIXER ,"ADAT External Master Clock" ,2 ,0 ,0 ),
@@ -928,7 +928,7 @@ static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, str .private_value = xshift | (xinvert << 8),\ } -static struct snd_kcontrol_new snd_ice1712_6fire_controls[] = { +static const struct snd_kcontrol_new snd_ice1712_6fire_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Analog Input Select" ,
sound/pci/ice1712/ice1712.c +1 -1
@@ -1335,7 +1335,7 @@ static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struc static const DECLARE_TLV_DB_SCALE(db_scale_playback, -14400, 150, 0); -static struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] = { +static const struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Multi Playback Switch" ,
sound/pci/ice1712/juli.c +1 -1
@@ -343,7 +343,7 @@ static int juli_mute_put(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new juli_mute_controls[] = { +static const struct snd_kcontrol_new juli_mute_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Switch" ,
sound/pci/ice1712/maya44.c +1 -1
@@ -424,7 +424,7 @@ static int maya_pb_route_put(struct snd_kcontrol *kcontrol,* controls to be added */ -static struct snd_kcontrol_new maya_controls[] = { +static const struct snd_kcontrol_new maya_controls[] = { { .name ="Crossmix Playback Volume" , .iface =SNDRV_CTL_ELEM_IFACE_MIXER ,
sound/pci/ice1712/phase.c +2 -2
@@ -745,7 +745,7 @@ static int phase28_oversampling_put(struct snd_kcontrol *kcontrol, static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); -static struct snd_kcontrol_new phase28_dac_controls[] = { +static const struct snd_kcontrol_new phase28_dac_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Switch" ,
@@ -860,7 +860,7 @@ static struct snd_kcontrol_new phase28_dac_controls[] = { } }; -static struct snd_kcontrol_new wm_controls[] = { +static const struct snd_kcontrol_new wm_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="PCM Playback Switch" ,
sound/pci/ice1712/pontis.c +1 -1
@@ -529,7 +529,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_volume, -6400, 50, 1);* mixers */ -static struct snd_kcontrol_new pontis_controls[] = { +static const struct snd_kcontrol_new pontis_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
sound/pci/ice1712/prodigy192.c +2 -2
@@ -346,7 +346,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0);* mixers */ -static struct snd_kcontrol_new stac_controls[] = { +static const struct snd_kcontrol_new stac_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Switch" ,
@@ -578,7 +578,7 @@ static int ak4114_input_sw_put(struct snd_kcontrol *kcontrol, } -static struct snd_kcontrol_new ak4114_controls[] = { +static const struct snd_kcontrol_new ak4114_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="MIODIO IEC958 Capture Input" ,
sound/pci/ice1712/prodigy_hifi.c +2 -2
@@ -284,7 +284,7 @@ static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); -static struct snd_kcontrol_new prodigy_hd2_controls[] = { +static const struct snd_kcontrol_new prodigy_hd2_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
@@ -741,7 +741,7 @@ static int wm_chswap_put(struct snd_kcontrol *kcontrol,* mixers */ -static struct snd_kcontrol_new prodigy_hifi_controls[] = { +static const struct snd_kcontrol_new prodigy_hifi_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
sound/pci/ice1712/quartet.c +1 -1
@@ -720,7 +720,7 @@ static int qtet_sw_put(struct snd_kcontrol *kcontrol, .put = qtet_sw_put,\ .private_value = xpriv } -static struct snd_kcontrol_new qtet_controls[] = { +static const struct snd_kcontrol_new qtet_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Switch" ,
sound/pci/ice1712/wtm.c +1 -1
@@ -477,7 +477,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0);/* * Control tabs */ -static struct snd_kcontrol_new stac9640_controls[] = { +static const struct snd_kcontrol_new stac9640_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
sound/pci/korg1212/korg1212.c +1 -1
@@ -2019,7 +2019,7 @@ static int snd_korg1212_control_sync_put(struct snd_kcontrol *kcontrol, .private_value = ord, \ } -static struct snd_kcontrol_new snd_korg1212_controls[] = { +static const struct snd_kcontrol_new snd_korg1212_controls[] = {MON_MIXER (8 ,"Analog" ),MON_MIXER (10 ,"SPDIF" ),MON_MIXER (0 ,"ADAT-1" ),MON_MIXER (1 ,"ADAT-2" ),MON_MIXER (2 ,"ADAT-3" ),MON_MIXER (3 ,"ADAT-4" ),
sound/pci/rme32.c +1 -1
@@ -1796,7 +1796,7 @@ static int snd_rme32_control_spdif_mask_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new snd_rme32_controls[] = { +static const struct snd_kcontrol_new snd_rme32_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name =SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,DEFAULT ),
sound/pci/rme96.c +1 -1
@@ -2253,7 +2253,7 @@ snd_rme96_dac_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valureturn change; } -static struct snd_kcontrol_new snd_rme96_controls[] = { +static const struct snd_kcontrol_new snd_rme96_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name =SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,DEFAULT ),
sound/pci/rme9652/hdsp.c +4 -4
@@ -2879,7 +2879,7 @@ static int snd_hdsp_put_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ctlreturn change; } -static struct snd_kcontrol_new snd_hdsp_9632_controls[] = { +static const struct snd_kcontrol_new snd_hdsp_9632_controls[] = {HDSP_DA_GAIN ("DA Gain" ,0 ),HDSP_AD_GAIN ("AD Gain" ,0 ),HDSP_PHONE_GAIN ("Phones Gain" ,0 ),
@@ -2887,7 +2887,7 @@ HDSP_TOGGLE_SETTING("XLR Breakout Cable", HDSP_XLRBreakoutCable),HDSP_DDS_OFFSET ("DDS Sample Rate Offset" ,0 ) }; -static struct snd_kcontrol_new snd_hdsp_controls[] = { +static const struct snd_kcontrol_new snd_hdsp_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name =SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,DEFAULT ),
@@ -3216,7 +3216,7 @@ static int snd_hdsp_info_rpm_disconnect(struct snd_kcontrol *kcontrol, struct snreturn snd_ctl_enum_info (uinfo,1 ,2 , texts); } -static struct snd_kcontrol_new snd_hdsp_rpm_controls[] = { +static const struct snd_kcontrol_new snd_hdsp_rpm_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="RPM Bypass" ,
@@ -3249,7 +3249,7 @@ static struct snd_kcontrol_new snd_hdsp_rpm_controls[] = { HDSP_MIXER("Mixer", 0) }; -static struct snd_kcontrol_new snd_hdsp_96xx_aeb = +static const struct snd_kcontrol_new snd_hdsp_96xx_aeb =HDSP_TOGGLE_SETTING ("Analog Extension Board" , HDSP_AnalogExtensionBoard);static struct snd_kcontrol_new snd_hdsp_adat_sync_check =HDSP_ADAT_SYNC_CHECK ;
sound/pci/rme9652/hdspm.c +7 -7
@@ -4478,7 +4478,7 @@ static int snd_hdspm_put_tco_word_term(struct snd_kcontrol *kcontrol, -static struct snd_kcontrol_new snd_hdspm_controls_madi[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_madi[] = {HDSPM_MIXER ("Mixer" ,0 ),HDSPM_INTERNAL_CLOCK ("Internal Clock" ,0 ),HDSPM_SYSTEM_CLOCK_MODE ("System Clock Mode" ,0 ),
@@ -4500,7 +4500,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_madi[] = { }; -static struct snd_kcontrol_new snd_hdspm_controls_madiface[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_madiface[] = {HDSPM_MIXER ("Mixer" ,0 ),HDSPM_INTERNAL_CLOCK ("Internal Clock" ,0 ),HDSPM_SYSTEM_CLOCK_MODE ("System Clock Mode" ,0 ),
@@ -4513,7 +4513,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_madiface[] = {HDSPM_MADI_SPEEDMODE ("MADI Speed Mode" ,0 ) }; -static struct snd_kcontrol_new snd_hdspm_controls_aio[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_aio[] = {HDSPM_MIXER ("Mixer" ,0 ),HDSPM_INTERNAL_CLOCK ("Internal Clock" ,0 ),HDSPM_SYSTEM_CLOCK_MODE ("System Clock Mode" ,0 ),
@@ -4554,7 +4554,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_aio[] = {*/ }; -static struct snd_kcontrol_new snd_hdspm_controls_raydat[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_raydat[] = {HDSPM_MIXER ("Mixer" ,0 ),HDSPM_INTERNAL_CLOCK ("Internal Clock" ,0 ),HDSPM_SYSTEM_CLOCK_MODE ("Clock Mode" ,0 ),
@@ -4582,7 +4582,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_raydat[] = {HDSPM_TOGGLE_SETTING ("Single Speed WordClock Out" , HDSPM_c0_Wck48) }; -static struct snd_kcontrol_new snd_hdspm_controls_aes32[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_aes32[] = {HDSPM_MIXER ("Mixer" ,0 ),HDSPM_INTERNAL_CLOCK ("Internal Clock" ,0 ),HDSPM_SYSTEM_CLOCK_MODE ("System Clock Mode" ,0 ),
@@ -4624,7 +4624,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_aes32[] = {/* Control elements for the optional TCO module */ -static struct snd_kcontrol_new snd_hdspm_controls_tco[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_tco[] = {HDSPM_TCO_SAMPLE_RATE ("TCO Sample Rate" ,0 ),HDSPM_TCO_PULL ("TCO Pull" ,0 ),HDSPM_TCO_WCK_CONVERSION ("TCO WCK Conversion" ,0 ),
@@ -4671,7 +4671,7 @@ static int snd_hdspm_create_controls(struct snd_card *card,unsigned int idx, limit;int err;struct snd_kcontrol *kctl; -struct snd_kcontrol_new *list =NULL ; +const struct snd_kcontrol_new *list =NULL ;switch (hdspm->io_type) {case MADI :
sound/pci/rme9652/rme9652.c +3 -3
@@ -1454,7 +1454,7 @@ static int snd_rme9652_get_tc_value(void *private_data,#endif /* ALSA_HAS_STANDARD_WAY_OF_RETURNING_TIMECODE */ -static struct snd_kcontrol_new snd_rme9652_controls[] = { +static const struct snd_kcontrol_new snd_rme9652_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name =SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,DEFAULT ),
@@ -1509,10 +1509,10 @@ RME9652_TC_VALID("Timecode Valid", 0), RME9652_PASSTHRU("Passthru", 0) }; -static struct snd_kcontrol_new snd_rme9652_adat3_check = +static const struct snd_kcontrol_new snd_rme9652_adat3_check =RME9652_ADAT_SYNC ("ADAT3 Sync Check" ,0 ,2 ); -static struct snd_kcontrol_new snd_rme9652_adat1_input = +static const struct snd_kcontrol_new snd_rme9652_adat1_input =RME9652_ADAT1_IN ("ADAT1 Input Source" ,0 );static int snd_rme9652_create_controls (struct snd_card *card,struct snd_rme9652 *rme9652)
sound/pci/sonicvibes.c +3 -3
@@ -1050,7 +1050,7 @@ static int snd_sonicvibes_put_double(struct snd_kcontrol *kcontrol, struct snd_creturn change; } -static struct snd_kcontrol_new snd_sonicvibes_controls[] = { +static const struct snd_kcontrol_new snd_sonicvibes_controls[] = {SONICVIBES_DOUBLE ("Capture Volume" ,0 ,SV_IREG_LEFT_ADC ,SV_IREG_RIGHT_ADC ,0 ,0 ,15 ,0 ),SONICVIBES_DOUBLE ("Aux Playback Switch" ,0 ,SV_IREG_LEFT_AUX1 ,SV_IREG_RIGHT_AUX1 ,7 ,7 ,1 ,1 ),SONICVIBES_DOUBLE ("Aux Playback Volume" ,0 ,SV_IREG_LEFT_AUX1 ,SV_IREG_RIGHT_AUX1 ,0 ,0 ,31 ,1 ),
@@ -1149,7 +1149,7 @@ static void snd_sonicvibes_proc_init(struct sonicvibes *sonic)*/ #ifdef SUPPORT_JOYSTICK -static struct snd_kcontrol_new snd_sonicvibes_game_control = +static const struct snd_kcontrol_new snd_sonicvibes_game_control =SONICVIBES_SINGLE ("Joystick Speed" ,0 ,SV_IREG_GAME_PORT ,1 ,15 ,0 );static int snd_sonicvibes_create_gameport (struct sonicvibes *sonic)
@@ -1375,7 +1375,7 @@ static int snd_sonicvibes_create(struct snd_card *card,* MIDI section */ -static struct snd_kcontrol_new snd_sonicvibes_midi_controls[] = { +static const struct snd_kcontrol_new snd_sonicvibes_midi_controls[] = {SONICVIBES_SINGLE ("SonicVibes Wave Source RAM" ,0 ,SV_IREG_WAVE_SOURCE ,0 ,1 ,0 ),SONICVIBES_SINGLE ("SonicVibes Wave Source RAM+ROM" ,0 ,SV_IREG_WAVE_SOURCE ,1 ,1 ,0 ),SONICVIBES_SINGLE ("SonicVibes Onboard Synth" ,0 ,SV_IREG_MPU401 ,0 ,1 ,0 ),
sound/pci/ymfpci/ymfpci_main.c +1 -1
@@ -1588,7 +1588,7 @@ static const struct snd_kcontrol_new snd_ymfpci_dup4ch = { .put = snd_ymfpci_put_dup4ch, }; -static struct snd_kcontrol_new snd_ymfpci_controls[] = { +static const struct snd_kcontrol_new snd_ymfpci_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Wave Playback Volume" ,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 38/58 ALSA: ppc: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/ppc/awacs.c | 50 +++++++++++++++++++++++++------------------------- sound/ppc/burgundy.c | 20 ++++++++++---------- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 2 +- sound/ppc/snd_ps3.c | 2 +- sound/ppc/tumbler.c | 4 ++-- 6 files changed, 40 insertions(+), 40 deletions(-)
sound/ppc/awacs.c +25 -25
@@ -464,7 +464,7 @@ static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,#define AMP_CH_SPK 0#define AMP_CH_HD 1 -static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Speaker Playback Volume" , .info = snd_pmac_awacs_info_volume_amp,
@@ -582,46 +582,46 @@ static int snd_pmac_screamer_mic_boost_put(struct snd_kcontrol *kcontrol,/* * lists of mixer elements */ -static struct snd_kcontrol_new snd_pmac_awacs_mixers[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers[] = {AWACS_SWITCH ("Master Capture Switch" ,1 ,SHIFT_LOOPTHRU ,0 ),AWACS_VOLUME ("Master Capture Volume" ,0 ,4 ,0 ),/* AWACS_SWITCH("Unknown Playback Switch", 6, SHIFT_PAROUT0, 0), */ }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] = {AWACS_VOLUME ("Master Playback Volume" ,2 ,6 ,1 ),AWACS_VOLUME ("Play-through Playback Volume" ,5 ,6 ,1 ),AWACS_SWITCH ("Line Capture Switch" ,0 ,SHIFT_MUX_MIC ,0 ),AWACS_SWITCH ("CD Capture Switch" ,0 ,SHIFT_MUX_LINE ,0 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] = {AWACS_VOLUME ("Line out Playback Volume" ,2 ,6 ,1 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] = {AWACS_VOLUME ("Play-through Playback Volume" ,5 ,6 ,1 ),AWACS_SWITCH ("CD Capture Switch" ,0 ,SHIFT_MUX_CD ,0 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] = {AWACS_VOLUME ("Line out Playback Volume" ,2 ,6 ,1 ),AWACS_VOLUME ("Master Playback Volume" ,5 ,6 ,1 ),AWACS_SWITCH ("CD Capture Switch" ,0 ,SHIFT_MUX_CD ,0 ),AWACS_SWITCH ("Line Capture Switch" ,0 ,SHIFT_MUX_MIC ,0 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] = {AWACS_VOLUME ("Line out Playback Volume" ,2 ,6 ,1 ),AWACS_SWITCH ("CD Capture Switch" ,0 ,SHIFT_MUX_CD ,0 ),AWACS_SWITCH ("Line Capture Switch" ,0 ,SHIFT_MUX_MIC ,0 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] = {AWACS_VOLUME ("Headphone Playback Volume" ,2 ,6 ,1 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = {AWACS_VOLUME ("Master Playback Volume" ,2 ,6 ,1 ),AWACS_SWITCH ("CD Capture Switch" ,0 ,SHIFT_MUX_CD ,0 ), };
@@ -629,34 +629,34 @@ static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = {/* FIXME: is this correct order? * screamer (powerbook G3 pismo) seems to have different bits... */ -static struct snd_kcontrol_new snd_pmac_awacs_mixers2[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers2[] = {AWACS_SWITCH ("Line Capture Switch" ,0 ,SHIFT_MUX_LINE ,0 ),AWACS_SWITCH ("Mic Capture Switch" ,0 ,SHIFT_MUX_MIC ,0 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers2[] = {AWACS_SWITCH ("Line Capture Switch" ,0 ,SHIFT_MUX_MIC ,0 ),AWACS_SWITCH ("Mic Capture Switch" ,0 ,SHIFT_MUX_LINE ,0 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] = {AWACS_SWITCH ("CD Capture Switch" ,0 ,SHIFT_MUX_CD ,0 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_master_sw = +static const struct snd_kcontrol_new snd_pmac_awacs_master_sw =AWACS_SWITCH ("Master Playback Switch" ,1 ,SHIFT_HDMUTE ,1 ); -static struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac = +static const struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac =AWACS_SWITCH ("Line out Playback Switch" ,1 ,SHIFT_HDMUTE ,1 ); -static struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 = +static const struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 =AWACS_SWITCH ("Headphone Playback Switch" ,1 ,SHIFT_HDMUTE ,1 ); -static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] = {AWACS_SWITCH ("Mic Boost Capture Switch" ,0 ,SHIFT_GAINLINE ,0 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Mic Boost Capture Volume" , .info = snd_pmac_screamer_mic_boost_info,
@@ -665,34 +665,34 @@ static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = { }, }; -static struct snd_kcontrol_new snd_pmac_awacs_mic_boost_pmac7500[] = +static const struct snd_kcontrol_new snd_pmac_awacs_mic_boost_pmac7500[] = {AWACS_SWITCH ("Line Boost Capture Switch" ,0 ,SHIFT_GAINLINE ,0 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_beige[] = +static const struct snd_kcontrol_new snd_pmac_screamer_mic_boost_beige[] = {AWACS_SWITCH ("Line Boost Capture Switch" ,0 ,SHIFT_GAINLINE ,0 ),AWACS_SWITCH ("CD Boost Capture Switch" ,6 ,SHIFT_MIC_BOOST ,0 ), }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_imac[] = +static const struct snd_kcontrol_new snd_pmac_screamer_mic_boost_imac[] = {AWACS_SWITCH ("Line Boost Capture Switch" ,0 ,SHIFT_GAINLINE ,0 ),AWACS_SWITCH ("Mic Boost Capture Switch" ,6 ,SHIFT_MIC_BOOST ,0 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] = {AWACS_VOLUME ("Speaker Playback Volume" ,4 ,6 ,1 ), }; -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw = +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_sw =AWACS_SWITCH ("Speaker Playback Switch" ,1 ,SHIFT_SPKMUTE ,1 ); -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 = +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 =AWACS_SWITCH ("Speaker Playback Switch" ,1 ,SHIFT_PAROUT1 ,1 ); -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 = +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 =AWACS_SWITCH ("Speaker Playback Switch" ,1 ,SHIFT_PAROUT1 ,0 );
@@ -700,7 +700,7 @@ AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_PAROUT1, 0);* add new mixer elements to the card */ static int build_mixers (struct snd_pmac *chip,int nums, -struct snd_kcontrol_new *mixers) +const struct snd_kcontrol_new *mixers) {int i, err;
sound/ppc/burgundy.c +10 -10
@@ -454,7 +454,7 @@ static int snd_pmac_burgundy_put_switch_b(struct snd_kcontrol *kcontrol,/* * Burgundy mixers */ -static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = { +static const struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = {BURGUNDY_VOLUME_W ("Master Playback Volume" ,0 ,MASK_ADDR_BURGUNDY_MASTER_VOLUME ,8 ), BURGUNDY_VOLUME_W("CD Capture Volume", 0,
@@ -482,7 +482,7 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = {*/ BURGUNDY_SWITCH_B ("PCM Capture Switch" ,0 ,MASK_ADDR_BURGUNDY_HOSTIFEH ,0x01 ,0 ,0 ) }; -static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = { +static const struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = {BURGUNDY_VOLUME_W ("Line in Capture Volume" ,0 ,MASK_ADDR_BURGUNDY_VOLLINE ,16 ), BURGUNDY_VOLUME_W("Mic Capture Volume", 0,
@@ -508,7 +508,7 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = {BURGUNDY_SWITCH_B ("Mic Boost Capture Switch" ,0 ,MASK_ADDR_BURGUNDY_INPBOOST ,0x40 ,0x80 ,1 ) }; -static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = { +static const struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = {BURGUNDY_VOLUME_W ("Line in Capture Volume" ,0 ,MASK_ADDR_BURGUNDY_VOLMIC ,16 ), BURGUNDY_VOLUME_B("Line in Gain Capture Volume", 0,
@@ -524,33 +524,33 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = {/* BURGUNDY_SWITCH_B("Line in Boost Capture Switch", 0, * MASK_ADDR_BURGUNDY_INPBOOST, 0x40, 0x80, 1) */ }; -static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_master_sw_imac =BURGUNDY_SWITCH_B ("Master Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_OUTPUT_LEFT |BURGUNDY_LINEOUT_LEFT |BURGUNDY_HP_LEFT ,BURGUNDY_OUTPUT_RIGHT |BURGUNDY_LINEOUT_RIGHT |BURGUNDY_HP_RIGHT ,1 ); -static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_pmac = +static const struct snd_kcontrol_new snd_pmac_burgundy_master_sw_pmac =BURGUNDY_SWITCH_B ("Master Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_OUTPUT_INTERN |BURGUNDY_OUTPUT_LEFT ,BURGUNDY_OUTPUT_RIGHT ,1 ); -static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_imac =BURGUNDY_SWITCH_B ("Speaker Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_OUTPUT_LEFT ,BURGUNDY_OUTPUT_RIGHT ,1 ); -static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_pmac = +static const struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_pmac =BURGUNDY_SWITCH_B ("Speaker Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_OUTPUT_INTERN ,0 ,0 ); -static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_line_sw_imac =BURGUNDY_SWITCH_B ("Line out Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_LINEOUT_LEFT ,BURGUNDY_LINEOUT_RIGHT ,1 ); -static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_pmac = +static const struct snd_kcontrol_new snd_pmac_burgundy_line_sw_pmac =BURGUNDY_SWITCH_B ("Line out Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_OUTPUT_LEFT ,BURGUNDY_OUTPUT_RIGHT ,1 ); -static struct snd_kcontrol_new snd_pmac_burgundy_hp_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_hp_sw_imac =BURGUNDY_SWITCH_B ("Headphone Playback Switch" ,0 ,MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES ,BURGUNDY_HP_LEFT ,BURGUNDY_HP_RIGHT ,1 );
sound/ppc/daca.c +1 -1
@@ -186,7 +186,7 @@ static int daca_put_amp(struct snd_kcontrol *kcontrol,return change; } -static struct snd_kcontrol_new daca_mixers[] = { +static const struct snd_kcontrol_new daca_mixers[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Deemphasis Switch" , .info = daca_info_deemphasis,
sound/ppc/pmac.c +1 -1
@@ -1104,7 +1104,7 @@ static int pmac_hp_detect_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new auto_mute_controls[] = { +static const struct snd_kcontrol_new auto_mute_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Auto Mute Switch" , .info = snd_pmac_boolean_mono_info,
sound/ppc/snd_ps3.c +1 -1
@@ -715,7 +715,7 @@ static int snd_ps3_spdif_default_put(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new spdif_ctls[] = { +static const struct snd_kcontrol_new spdif_ctls[] = { { .access =SNDRV_CTL_ELEM_ACCESS_READ , .iface =SNDRV_CTL_ELEM_IFACE_PCM ,
sound/ppc/tumbler.c +2 -2
@@ -826,7 +826,7 @@ static int snapper_put_capture_source(struct snd_kcontrol *kcontrol,/* */ -static struct snd_kcontrol_new tumbler_mixers[] = { +static const struct snd_kcontrol_new tumbler_mixers[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Volume" , .info = tumbler_info_master_volume,
@@ -850,7 +850,7 @@ static struct snd_kcontrol_new tumbler_mixers[] = { }, }; -static struct snd_kcontrol_new snapper_mixers[] = { +static const struct snd_kcontrol_new snapper_mixers[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Master Playback Volume" , .info = tumbler_info_master_volume,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 39/58 ALSA: sparc: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/sparc/amd7930.c | 2 +- sound/sparc/cs4231.c | 2 +- sound/sparc/dbri.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/sparc/amd7930.c +1 -1
@@ -837,7 +837,7 @@ static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elemreturn change; } -static struct snd_kcontrol_new amd7930_controls[] = { +static const struct snd_kcontrol_new amd7930_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Monitor Volume" ,
sound/sparc/cs4231.c +1 -1
@@ -1479,7 +1479,7 @@ static int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, .private_value = (left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | \ ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22) } -static struct snd_kcontrol_new snd_cs4231_controls[] = { +static const struct snd_kcontrol_new snd_cs4231_controls[] = {CS4231_DOUBLE ("PCM Playback Switch" ,0 ,CS4231_LEFT_OUTPUT ,CS4231_RIGHT_OUTPUT ,7 ,7 ,1 ,1 ), CS4231_DOUBLE("PCM Playback Volume", 0, CS4231_LEFT_OUTPUT,
sound/sparc/dbri.c +1 -1
@@ -2410,7 +2410,7 @@ static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol, .private_value = (entry) | ((shift) << 8) | ((mask) << 16) | \ ((invert) << 24) }, -static struct snd_kcontrol_new dbri_controls[] = { +static const struct snd_kcontrol_new dbri_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Playback Volume" ,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 40/58 ALSA: spi: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/spi/at73c213.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/spi/at73c213.c +1 -1
@@ -657,7 +657,7 @@ static int snd_at73c213_aux_capture_volume_info( | (mask << 24) | (invert << 22)) \ } -static struct snd_kcontrol_new snd_at73c213_controls[] = { +static const struct snd_kcontrol_new snd_at73c213_controls[] = {AT73C213_STEREO ("Master Playback Volume" ,0 ,DAC_LMPG ,DAC_RMPG ,0 ,0 ,0x1f ,1 ),AT73C213_STEREO ("Master Playback Switch" ,0 ,DAC_LMPG ,DAC_RMPG ,5 ,5 ,1 ,1 ),AT73C213_STEREO ("PCM Playback Volume" ,0 ,DAC_LLOG ,DAC_RLOG ,0 ,0 ,0x1f ,1 ),
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 41/58 ALSA: usb: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/usb/6fire/control.c | 8 ++++---- sound/usb/mixer.c | 6 +++--- sound/usb/mixer.h | 2 +- sound/usb/mixer_quirks.c | 16 ++++++++-------- sound/usb/mixer_us16x08.c | 38 +++++++++++++++++++------------------- sound/usb/mixer_us16x08.h | 2 +- 6 files changed, 36 insertions(+), 36 deletions(-)
sound/usb/6fire/control.c +4 -4
@@ -397,7 +397,7 @@ static int usb6fire_control_digital_thru_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new vol_elements[] = { +static const struct snd_kcontrol_new vol_elements[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Analog Playback Volume" ,
@@ -437,7 +437,7 @@ static struct snd_kcontrol_new vol_elements[] = { {} }; -static struct snd_kcontrol_new mute_elements[] = { +static const struct snd_kcontrol_new mute_elements[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Analog Playback Switch" ,
@@ -471,7 +471,7 @@ static struct snd_kcontrol_new mute_elements[] = { {} }; -static struct snd_kcontrol_new elements[] = { +static const struct snd_kcontrol_new elements[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Line/Phono Capture Route" ,
@@ -517,7 +517,7 @@ static int usb6fire_control_add_virtual(struct control_runtime *rt, struct snd_card *card, char *name, - struct snd_kcontrol_new *elems) + const struct snd_kcontrol_new *elems) { int ret;int i;
sound/usb/mixer.c +3 -3
@@ -1445,7 +1445,7 @@ static int mixer_ctl_connector_get(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new usb_feature_unit_ctl = { +static const struct snd_kcontrol_new usb_feature_unit_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="" ,/* will be filled later manually */ .info = mixer_ctl_feature_info,
@@ -1466,7 +1466,7 @@ static const struct snd_kcontrol_new usb_feature_unit_ctl_ro = {* A control which shows the boolean value from reading a UAC control on * the master channel. */ -static struct snd_kcontrol_new usb_bool_master_control_ctl_ro = { +static const struct snd_kcontrol_new usb_bool_master_control_ctl_ro = { .iface =SNDRV_CTL_ELEM_IFACE_CARD , .name ="" ,/* will be filled later manually */ .access =SNDRV_CTL_ELEM_ACCESS_READ ,
@@ -1488,7 +1488,7 @@ static const struct snd_kcontrol_new usb_connector_ctl_ro = {* This symbol is exported in order to allow the mixer quirks to * hook up to the standard feature unit control mechanism */ -struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl; +const struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl;/* * build a feature control
sound/usb/mixer.h +1 -1
@@ -116,6 +116,6 @@ int snd_usb_get_cur_mix_value(struct usb_mixer_elem_info *cval,extern void snd_usb_mixer_elem_free (struct snd_kcontrol *kctl); -extern struct snd_kcontrol_new *snd_usb_feature_unit_ctl; +extern const struct snd_kcontrol_new *snd_usb_feature_unit_ctl;#endif /* __USBMIXER_H */
sound/usb/mixer_quirks.c +8 -8
@@ -507,7 +507,7 @@ static int snd_emu0204_ch_switch_resume(struct usb_mixer_elem_list *list) list->kctl->private_value); } -static struct snd_kcontrol_new snd_emu0204_control = { +static const struct snd_kcontrol_new snd_emu0204_control = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Front Jack Channels" , .info = snd_emu0204_ch_switch_info,
@@ -575,7 +575,7 @@ static int snd_xonar_u1_switch_resume(struct usb_mixer_elem_list *list) list->kctl->private_value); } -static struct snd_kcontrol_new snd_xonar_u1_output_switch = { +static const struct snd_kcontrol_new snd_xonar_u1_output_switch = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Digital Playback Switch" , .info = snd_ctl_boolean_mono_info,
@@ -702,7 +702,7 @@ static int snd_mbox1_switch_resume(struct usb_mixer_elem_list *list)return snd_mbox1_switch_update (list->mixer, list->kctl->private_value); } -static struct snd_kcontrol_new snd_mbox1_switch = { +static const struct snd_kcontrol_new snd_mbox1_switch = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Clock Source" , .index =0 ,
@@ -787,7 +787,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,return err <0 ? err :1 ; } -static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { +static const struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { { .name ="Direct Thru Channel A" , .private_value =_MAKE_NI_CONTROL (0x01 ,0x03 ),
@@ -806,7 +806,7 @@ static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { }, }; -static struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = { +static const struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = { { .name ="Direct Thru Channel A" , .private_value =_MAKE_NI_CONTROL (0x01 ,0x03 ),
@@ -1662,7 +1662,7 @@ static int snd_microii_spdif_switch_put(struct snd_kcontrol *kcontrol,return err <0 ? err :1 ; } -static struct snd_kcontrol_new snd_microii_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_microii_mixer_spdif[] = { { .iface =SNDRV_CTL_ELEM_IFACE_PCM , .name =SNDRV_CTL_NAME_IEC958 ("" ,PLAYBACK ,DEFAULT ),
@@ -1769,7 +1769,7 @@ static int snd_soundblaster_e1_switch_info(struct snd_kcontrol *kcontrol,return snd_ctl_enum_info (uinfo,1 ,ARRAY_SIZE (texts), texts); } -static struct snd_kcontrol_new snd_soundblaster_e1_input_switch = { +static const struct snd_kcontrol_new snd_soundblaster_e1_input_switch = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="Input Source" , .info = snd_soundblaster_e1_switch_info,
@@ -2093,7 +2093,7 @@ static int snd_rme_sync_source_info(struct snd_kcontrol *kcontrol, ARRAY_SIZE(sync_sources), sync_sources); } -static struct snd_kcontrol_new snd_rme_controls[] = { +static const struct snd_kcontrol_new snd_rme_controls[] = { { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .name ="AES Rate" ,
sound/usb/mixer_us16x08.c +19 -19
@@ -760,7 +760,7 @@ static int snd_us16x08_meter_put(struct snd_kcontrol *kcontrol,return 1 ; } -static struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { +static const struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -770,7 +770,7 @@ static struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { +static const struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -780,7 +780,7 @@ static struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133) }; -static struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { +static const struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -790,7 +790,7 @@ static struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 255) }; -static struct snd_kcontrol_new snd_us16x08_master_ctl = { +static const struct snd_kcontrol_new snd_us16x08_master_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =1 ,
@@ -800,7 +800,7 @@ static struct snd_kcontrol_new snd_us16x08_master_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133) }; -static struct snd_kcontrol_new snd_us16x08_route_ctl = { +static const struct snd_kcontrol_new snd_us16x08_route_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =8 ,
@@ -810,7 +810,7 @@ static struct snd_kcontrol_new snd_us16x08_route_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 9) }; -static struct snd_kcontrol_new snd_us16x08_bus_ctl = { +static const struct snd_kcontrol_new snd_us16x08_bus_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =1 ,
@@ -820,7 +820,7 @@ static struct snd_kcontrol_new snd_us16x08_bus_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { +static const struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -830,7 +830,7 @@ static struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -841,7 +841,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { 0, 0x20) }; -static struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -852,7 +852,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { sizeof(ratio_map) - 1), /*max*/ }; -static struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -862,7 +862,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x14) }; -static struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -873,7 +873,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { SND_US16X08_KCSET(SND_US16X08_COMP_ATTACK_BIAS, 1, 0, 0xc6), }; -static struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -884,7 +884,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { SND_US16X08_KCSET(SND_US16X08_COMP_RELEASE_BIAS, 1, 0, 0x63), }; -static struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -894,7 +894,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 24), }; -static struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -904,7 +904,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x1F), }; -static struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -914,7 +914,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x3F) }; -static struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -924,7 +924,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x06) }; -static struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -935,7 +935,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = {SND_US16X08_KCSET (SND_US16X08_EQ_HIGHFREQ_BIAS ,1 ,0 ,0x1F ) }; -static struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =16 ,
@@ -945,7 +945,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_meter_ctl = { +static const struct snd_kcontrol_new snd_us16x08_meter_ctl = { .iface =SNDRV_CTL_ELEM_IFACE_MIXER , .access =SNDRV_CTL_ELEM_ACCESS_READWRITE , .count =1 ,
sound/usb/mixer_us16x08.h +1 -1
@@ -108,7 +108,7 @@ struct snd_us16x08_meter_store { };struct snd_us16x08_control_params { -struct snd_kcontrol_new *kcontrol_new; +const struct snd_kcontrol_new *kcontrol_new;int control_id;int type;int num_channels;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 42/58 ALSA: parisc: Constify snd_kcontrol_new items
In reply to Takashi IwaiMost of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization.
There should be no functional changes by this patch.
--- sound/parisc/harmony.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/parisc/harmony.c +1 -1
@@ -797,7 +797,7 @@ snd_harmony_captureroute_put(struct snd_kcontrol *kc, .private_value = ((left_shift) | ((right_shift) << 8) | \ ((mask) << 16) | ((invert) << 24)) } -static struct snd_kcontrol_new snd_harmony_controls[] = { +static const struct snd_kcontrol_new snd_harmony_controls[] = {HARMONY_VOLUME ("Master Playback Volume" ,HARMONY_GAIN_LO_SHIFT ,HARMONY_GAIN_RO_SHIFT ,HARMONY_GAIN_OUT ,1 ), HARMONY_VOLUME("Capture Volume", HARMONY_GAIN_LI_SHIFT,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 43/58 ALSA: dummy: Constify snd_pcm_ops definitions
In reply to Takashi IwaiThe snd_pcm_ops items defined in snd-dummy driver can be gracefully declared as const. Let's mark them for further optimization.
There should be no functional changes by this patch.
--- sound/drivers/dummy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/drivers/dummy.c +3 -3
@@ -644,7 +644,7 @@ static struct page *dummy_pcm_page(struct snd_pcm_substream *substream,return virt_to_page (dummy_page[substream->stream]);/* the same page */ } -static struct snd_pcm_ops dummy_pcm_ops = { +static const struct snd_pcm_ops dummy_pcm_ops = { .open = dummy_pcm_open, .close = dummy_pcm_close, .hw_params = dummy_pcm_hw_params,
@@ -653,7 +653,7 @@ static struct snd_pcm_ops dummy_pcm_ops = { .pointer = dummy_pcm_pointer, }; -static struct snd_pcm_ops dummy_pcm_ops_no_buf = { +static const struct snd_pcm_ops dummy_pcm_ops_no_buf = { .open = dummy_pcm_open, .close = dummy_pcm_close, .hw_params = dummy_pcm_hw_params,
@@ -670,7 +670,7 @@ static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams) {struct snd_pcm *pcm; -struct snd_pcm_ops *ops; +const struct snd_pcm_ops *ops;int err; err = snd_pcm_new(dummy->card, "Dummy PCM", device,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 44/58 ALSA: opl3: Constify snd_opl3_drum_voice definitions
In reply to Takashi IwaiThe snd_opl3_drum_voice items are all read-only, hence they can be declared as const.
There should be no functional changes by this patch.
--- sound/drivers/opl3/opl3_drums.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
sound/drivers/opl3/opl3_drums.c +13 -13
@@ -47,25 +47,25 @@ struct snd_opl3_drum_note {unsigned char feedback_connection; }; -static struct snd_opl3_drum_voice bass_op0 = {6 ,0 ,0x00 ,0x32 ,0xf8 ,0x66 ,0x30 ,0x00 }; -static struct snd_opl3_drum_voice bass_op1 = {6 ,1 ,0x00 ,0x03 ,0xf6 ,0x57 ,0x30 ,0x00 }; -static struct snd_opl3_drum_note bass_note = {6 ,0x90 ,0x09 }; +static const struct snd_opl3_drum_voice bass_op0 = {6 ,0 ,0x00 ,0x32 ,0xf8 ,0x66 ,0x30 ,0x00 }; +static const struct snd_opl3_drum_voice bass_op1 = {6 ,1 ,0x00 ,0x03 ,0xf6 ,0x57 ,0x30 ,0x00 }; +static const struct snd_opl3_drum_note bass_note = {6 ,0x90 ,0x09 }; -static struct snd_opl3_drum_voice hihat = {7 ,0 ,0x00 ,0x03 ,0xf0 ,0x06 ,0x20 ,0x00 }; +static const struct snd_opl3_drum_voice hihat = {7 ,0 ,0x00 ,0x03 ,0xf0 ,0x06 ,0x20 ,0x00 }; -static struct snd_opl3_drum_voice snare = {7 ,1 ,0x00 ,0x03 ,0xf0 ,0x07 ,0x20 ,0x02 }; -static struct snd_opl3_drum_note snare_note = {7 ,0xf4 ,0x0d }; +static const struct snd_opl3_drum_voice snare = {7 ,1 ,0x00 ,0x03 ,0xf0 ,0x07 ,0x20 ,0x02 }; +static const struct snd_opl3_drum_note snare_note = {7 ,0xf4 ,0x0d }; -static struct snd_opl3_drum_voice tomtom = {8 ,0 ,0x02 ,0x03 ,0xf0 ,0x06 ,0x10 ,0x00 }; -static struct snd_opl3_drum_note tomtom_note = {8 ,0xf4 ,0x09 }; +static const struct snd_opl3_drum_voice tomtom = {8 ,0 ,0x02 ,0x03 ,0xf0 ,0x06 ,0x10 ,0x00 }; +static const struct snd_opl3_drum_note tomtom_note = {8 ,0xf4 ,0x09 }; -static struct snd_opl3_drum_voice cymbal = {8 ,1 ,0x04 ,0x03 ,0xf0 ,0x06 ,0x10 ,0x00 }; +static const struct snd_opl3_drum_voice cymbal = {8 ,1 ,0x04 ,0x03 ,0xf0 ,0x06 ,0x10 ,0x00 };/* * set drum voice characteristics */ static void snd_opl3_drum_voice_set (struct snd_opl3 *opl3, -struct snd_opl3_drum_voice *data) +const struct snd_opl3_drum_voice *data) {unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];unsigned char voice_offset = data->voice;
@@ -100,7 +100,7 @@ static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3,* Set drum voice pitch */ static void snd_opl3_drum_note_set (struct snd_opl3 *opl3, -struct snd_opl3_drum_note *data) +const struct snd_opl3_drum_note *data) {unsigned char voice_offset = data->voice;unsigned short opl3_reg;
@@ -118,7 +118,7 @@ static void snd_opl3_drum_note_set(struct snd_opl3 *opl3,* Set drum voice volume and position */ static void snd_opl3_drum_vol_set (struct snd_opl3 *opl3, -struct snd_opl3_drum_voice *data, +const struct snd_opl3_drum_voice *data,int vel,struct snd_midi_channel *chan) {unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
@@ -170,7 +170,7 @@ void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off, struct snd_midi_channel *chan) {unsigned char drum_mask; -struct snd_opl3_drum_voice *drum_voice; +const struct snd_opl3_drum_voice *drum_voice;if (!(opl3->drum_reg &OPL3_PERCUSSION_ENABLE ))return ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 45/58 ALSA: ac97: Constify snd_ac97_res_table definition
In reply to Takashi IwaiOne snd_ac97_res_table definition remains forgotten without const. Let's add it for a bit of optimization.
There should be no functional changes by this patch.
--- sound/pci/ac97/ac97_patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ac97/ac97_patch.c +1 -1
@@ -3871,7 +3871,7 @@ static int mpatch_si3036(struct snd_ac97 * ac97)* check_volume_resolution(). */ -static struct snd_ac97_res_table lm4550_restbl[] = { +static const struct snd_ac97_res_table lm4550_restbl[] = { {AC97_MASTER ,0x1f1f }, {AC97_HEADPHONE ,0x1f1f }, {AC97_MASTER_MONO ,0x001f },
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 46/58 ALSA: ca0106: Constify snd_ca0106_category_str items
In reply to Takashi Iwaisnd_ca0106_con_category array is read-only and can be marked as const.
There should be no functional changes by this patch.
--- sound/pci/ca0106/ca0106_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ca0106/ca0106_proc.c +1 -1
@@ -66,7 +66,7 @@ struct snd_ca0106_category_str {const char *name; }; -static struct snd_ca0106_category_str snd_ca0106_con_category[] = { +static const struct snd_ca0106_category_str snd_ca0106_con_category[] = { {IEC958_AES1_CON_DAT ,"DAT" }, {IEC958_AES1_CON_VCR ,"VCR" }, {IEC958_AES1_CON_MICROPHONE ,"microphone" },
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 47/58 ALSA: ca0106: Constify snd_ca0106_details
In reply to Takashi IwaiThe snd_ca0106_details table entries are referred only as read-only. Let's make them const.
There should be no functional changes by this patch.
--- sound/pci/ca0106/ca0106.h | 2 +- sound/pci/ca0106/ca0106_main.c | 6 +++--- sound/pci/ca0106/ca0106_mixer.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
sound/pci/ca0106/ca0106.h +1 -1
@@ -663,7 +663,7 @@ struct snd_ca0106_details {// definition of the chip-specific record struct snd_ca0106 {struct snd_card *card; -struct snd_ca0106_details *details; +const struct snd_ca0106_details *details;struct pci_dev *pci;unsigned long port;
sound/pci/ca0106/ca0106_main.c +3 -3
@@ -156,7 +156,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model.");#include "ca0106.h" -static struct snd_ca0106_details ca0106_chip_details[] = { +static const struct snd_ca0106_details ca0106_chip_details[] = {/* Sound Blaster X-Fi Extreme Audio. This does not have an AC97. 53SB079000000 */ /* It is really just a normal SB Live 24bit. */ /* Tested:
@@ -503,7 +503,7 @@ static void restore_spdif_bits(struct snd_ca0106 *chip, int idx) }static int snd_ca0106_channel_dac (struct snd_ca0106 *chip, -struct snd_ca0106_details *details, +const struct snd_ca0106_details *details,int channel_id) {switch (channel_id) {
@@ -1593,7 +1593,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card, struct snd_ca0106 **rchip) {struct snd_ca0106 *chip; -struct snd_ca0106_details *c; +const struct snd_ca0106_details *c;int err;static const struct snd_device_ops ops = { .dev_free = snd_ca0106_dev_free,
sound/pci/ca0106/ca0106_mixer.c +1 -1
@@ -654,7 +654,7 @@ static const int spi_dmute_bit[] = { };static struct snd_kcontrol_new -snd_ca0106_volume_spi_dac_ctl (struct snd_ca0106_details *details, +snd_ca0106_volume_spi_dac_ctl (const struct snd_ca0106_details *details,int channel_id) {struct snd_kcontrol_new spi_switch = {0 };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 48/58 ALSA: ice17xx: Constify snd_ice1712_card_info
In reply to Takashi IwaiThe snd_ice1712_card_info objects are referred only as read-only. Let's make them const for further optimization.
There should be no functional changes by this patch.
--- sound/pci/ice1712/ice1712.c | 6 +++--- sound/pci/ice1712/ice1712.h | 2 +- sound/pci/ice1712/ice1724.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-)
sound/pci/ice1712/ice1712.c +3 -3
@@ -2218,7 +2218,7 @@ static const struct snd_kcontrol_new snd_ice1712_mixer_pro_peak = {/* * list of available boards */ -static struct snd_ice1712_card_info *card_tables[] = { +static const struct snd_ice1712_card_info *card_tables[] = { snd_ice1712_hoontech_cards, snd_ice1712_delta_cards, snd_ice1712_ews_cards,
@@ -2242,7 +2242,7 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, {int dev =ICE_I2C_EEPROM_ADDR ;/* I2C EEPROM device address */ unsigned int i, size; -struct snd_ice1712_card_info *const *tbl, *c; +const struct snd_ice1712_card_info *const *tbl, *c;if (!modelname || !*modelname) { ice->eeprom.subvendor =0 ;
@@ -2587,7 +2587,7 @@ static int snd_ice1712_probe(struct pci_dev *pci,struct snd_card *card;struct snd_ice1712 *ice;int pcm_dev =0 , err; -struct snd_ice1712_card_info *const *tbl, *c; +const struct snd_ice1712_card_info *const *tbl, *c;if (dev >=SNDRV_CARDS )return -ENODEV ;
sound/pci/ice1712/ice1712.h +1 -1
@@ -316,7 +316,7 @@ struct snd_ice1712 {struct snd_info_entry *proc_entry;struct snd_ice1712_eeprom eeprom; -struct snd_ice1712_card_info *card_info; +const struct snd_ice1712_card_info *card_info;unsigned int pro_volumes[20 ]; unsigned int omni:1; /* Delta Omni I/O */
sound/pci/ice1712/ice1724.c +6 -6
@@ -2170,13 +2170,13 @@ static const struct snd_kcontrol_new snd_vt1724_mixer_pro_peak = {* */ -static struct snd_ice1712_card_info no_matched; +static const struct snd_ice1712_card_info no_matched;/* ooAoo cards with no controls */ -static unsigned char ooaoo_sq210_eeprom[] = { +static const unsigned char ooaoo_sq210_eeprom[] = { [ICE_EEP2_SYSCONF ] =0x4c ,/* 49MHz crystal, no mpu401, no ADC, 1xDACs */ [ICE_EEP2_ACLINK ] =0x80 ,/* I2S */
@@ -2196,7 +2196,7 @@ static unsigned char ooaoo_sq210_eeprom[] = { }; -static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { +static const struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { { .name ="ooAoo SQ210a" , .model ="sq210a" ,
@@ -2206,7 +2206,7 @@ static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { { }/* terminator */ }; -static struct snd_ice1712_card_info *card_tables[] = { +static const struct snd_ice1712_card_info *card_tables[] = { snd_vt1724_revo_cards, snd_vt1724_amp_cards, snd_vt1724_aureon_cards,
@@ -2276,7 +2276,7 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, {const int dev =0xa0 ;/* EEPROM device address */ unsigned int i, size; -struct snd_ice1712_card_info *const *tbl, *c; +const struct snd_ice1712_card_info *const *tbl, *c;if (!modelname || !*modelname) { ice->eeprom.subvendor =0 ;
@@ -2590,7 +2590,7 @@ static int snd_vt1724_probe(struct pci_dev *pci,struct snd_card *card;struct snd_ice1712 *ice;int pcm_dev =0 , err; -struct snd_ice1712_card_info *const *tbl, *c; +const struct snd_ice1712_card_info *const *tbl, *c;if (dev >=SNDRV_CARDS )return -ENODEV ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 49/58 ALSA: ice1712: Constify wm-specific tables
In reply to Takashi IwaiThe tables defined in wm8766.c and wm8776.c are referred as read-only, hence they can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/ice1712/wm8766.c | 2 +- sound/pci/ice1712/wm8776.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/ice1712/wm8766.c +1 -1
@@ -26,7 +26,7 @@ static void snd_wm8766_write(struct snd_wm8766 *wm, u16 addr, u16 data) static const DECLARE_TLV_DB_SCALE(wm8766_tlv, -12750, 50, 1); -static struct snd_wm8766_ctl snd_wm8766_default_ctl[WM8766_CTL_COUNT ] = { +static const struct snd_wm8766_ctl snd_wm8766_default_ctl[WM8766_CTL_COUNT ] = { [WM8766_CTL_CH1_VOL ] = { .name ="Channel 1 Playback Volume" , .type =SNDRV_CTL_ELEM_TYPE_INTEGER ,
sound/pci/ice1712/wm8776.c +1 -1
@@ -129,7 +129,7 @@ static const DECLARE_TLV_DB_SCALE(wm8776_ngth_tlv, -7800, 600, 0); static const DECLARE_TLV_DB_SCALE(wm8776_maxatten_lim_tlv, -1200, 100, 0); static const DECLARE_TLV_DB_SCALE(wm8776_maxatten_alc_tlv, -2100, 400, 0); -static struct snd_wm8776_ctl snd_wm8776_default_ctl[WM8776_CTL_COUNT ] = { +static const struct snd_wm8776_ctl snd_wm8776_default_ctl[WM8776_CTL_COUNT ] = { [WM8776_CTL_DAC_VOL ] = { .name ="Master Playback Volume" , .type =SNDRV_CTL_ELEM_TYPE_INTEGER ,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 50/58 ALSA: line6: Constify snd_ratden definitions
In reply to Takashi IwaiThe snd_ratden definitions used in line6 drivers are all read-only, so they can be marked as const.
There should be no functional changes by this patch.
--- sound/usb/line6/pod.c | 2 +- sound/usb/line6/podhd.c | 2 +- sound/usb/line6/toneport.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/usb/line6/pod.c +1 -1
@@ -110,7 +110,7 @@ enum {POD_BUSY_MIDISEND }; -static struct snd_ratden pod_ratden = { +static const struct snd_ratden pod_ratden = { .num_min =78125 , .num_max =78125 , .num_step =1 ,
sound/usb/line6/podhd.c +1 -1
@@ -42,7 +42,7 @@ struct usb_line6_podhd {#define line6_to_podhd (x) container_of(x, struct usb_line6_podhd, line6) -static struct snd_ratden podhd_ratden = { +static const struct snd_ratden podhd_ratden = { .num_min =48000 , .num_max =48000 , .num_step =1 ,
sound/usb/line6/toneport.c +1 -1
@@ -63,7 +63,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2);#define TONEPORT_PCM_DELAY 1 -static struct snd_ratden toneport_ratden = { +static const struct snd_ratden toneport_ratden = { .num_min =44100 , .num_max =44100 , .num_step =1 ,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 51/58 ALSA: usx2y: Constify struct snd_usb_audio_quirk entries
In reply to Takashi IwaiThe quirk entries used in us122l and usx2y drivers can be declared as const as they are read-only.
There should be no functional changes by this patch.
--- sound/usb/usx2y/us122l.c | 8 ++++---- sound/usb/usx2y/usX2Yhwdep.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-)
sound/usb/usx2y/us122l.c +4 -4
@@ -40,13 +40,13 @@ static int snd_us122l_card_used[SNDRV_CARDS];static int us122l_create_usbmidi (struct snd_card *card) { -static struct snd_usb_midi_endpoint_info quirk_data = { +static const struct snd_usb_midi_endpoint_info quirk_data = { .out_ep =4 , .in_ep =3 , .out_cables =0x001 , .in_cables =0x001 }; -static struct snd_usb_audio_quirk quirk = { +static const struct snd_usb_audio_quirk quirk = { .vendor_name ="US122L" , .product_name =NAME_ALLCAPS , .ifnum =1 ,
@@ -62,13 +62,13 @@ static int us122l_create_usbmidi(struct snd_card *card)static int us144_create_usbmidi (struct snd_card *card) { -static struct snd_usb_midi_endpoint_info quirk_data = { +static const struct snd_usb_midi_endpoint_info quirk_data = { .out_ep =4 , .in_ep =3 , .out_cables =0x001 , .in_cables =0x001 }; -static struct snd_usb_audio_quirk quirk = { +static const struct snd_usb_audio_quirk quirk = { .vendor_name ="US144" , .product_name =NAME_ALLCAPS , .ifnum =0 ,
sound/usb/usx2y/usX2Yhwdep.c +5 -5
@@ -126,26 +126,26 @@ static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw,static int usX2Y_create_usbmidi (struct snd_card *card) { -static struct snd_usb_midi_endpoint_info quirk_data_1 = { +static const struct snd_usb_midi_endpoint_info quirk_data_1 = { .out_ep =0x06 , .in_ep =0x06 , .out_cables =0x001 , .in_cables =0x001 }; -static struct snd_usb_audio_quirk quirk_1 = { +static const struct snd_usb_audio_quirk quirk_1 = { .vendor_name ="TASCAM" , .product_name =NAME_ALLCAPS , .ifnum =0 , .type =QUIRK_MIDI_FIXED_ENDPOINT , .data = &quirk_data_1 }; -static struct snd_usb_midi_endpoint_info quirk_data_2 = { +static const struct snd_usb_midi_endpoint_info quirk_data_2 = { .out_ep =0x06 , .in_ep =0x06 , .out_cables =0x003 , .in_cables =0x003 }; -static struct snd_usb_audio_quirk quirk_2 = { +static const struct snd_usb_audio_quirk quirk_2 = { .vendor_name ="TASCAM" , .product_name ="US428" , .ifnum =0 ,
@@ -154,7 +154,7 @@ static int usX2Y_create_usbmidi(struct snd_card *card) };struct usb_device *dev =usX2Y (card)->dev;struct usb_interface *iface =usb_ifnum_to_if (dev,0 ); -struct snd_usb_audio_quirk *quirk = +const struct snd_usb_audio_quirk *quirk =le16_to_cpu (dev->descriptor.idProduct) ==USB_ID_US428 ? &quirk_2 : &quirk_1;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 52/58 ALSA: seq: oss: Constify snd_seq_oss_callback definitions
In reply to Takashi IwaiThe snd_seq_oss_callback items are just copied to another struct as-is, hence they can be declared as const.
There should be no functional changes by this patch.
--- sound/drivers/opl3/opl3_oss.c | 2 +- sound/synth/emux/emux_oss.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/drivers/opl3/opl3_oss.c +1 -1
@@ -16,7 +16,7 @@ static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg);/* operators */ -static struct snd_seq_oss_callback oss_callback = { +static const struct snd_seq_oss_callback oss_callback = { .owner =THIS_MODULE , .open = snd_opl3_open_seq_oss, .close = snd_opl3_close_seq_oss,
sound/synth/emux/emux_oss.c +1 -1
@@ -34,7 +34,7 @@ static void fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop);/* operators */ -static struct snd_seq_oss_callback oss_callback = { +static const struct snd_seq_oss_callback oss_callback = { .owner =THIS_MODULE , .open = snd_emux_open_seq_oss, .close = snd_emux_close_seq_oss,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 53/58 ALSA: bt87x: Constify snd_bt87x_boards
In reply to Takashi IwaiThe snd_bt87x_boards array is referred as read-only, hence it can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/bt87x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/bt87x.c +1 -1
@@ -150,7 +150,7 @@ struct snd_bt87x_board { unsigned no_digital:1; /* No digital input */ }; -static struct snd_bt87x_board snd_bt87x_boards[] = { +static const struct snd_bt87x_board snd_bt87x_boards[] = { [SND_BT87X_BOARD_UNKNOWN ] = { .dig_rate =32000 ,/* just a guess */ },
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 54/58 ALSA: emu10k1: Constify snd_emu_chip_details
In reply to Takashi IwaiThe snd_emu_chip_details definitions are referred as read-only, hence they can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/emu10k1/emu10k1_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/emu10k1/emu10k1_main.c +1 -1
@@ -1283,7 +1283,7 @@ static int snd_emu10k1_dev_free(struct snd_device *device)return snd_emu10k1_free (emu); } -static struct snd_emu_chip_details emu_chip_details[] = { +static const struct snd_emu_chip_details emu_chip_details[] = {/* Audigy 5/Rx SB1550 */ /* Tested by [email protected] 28 Mar 2015 */ /* DSP: CA10300-IAT LF
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 55/58 ALSA: es1968: Constify snd_es1968_tea575x_gpios
In reply to Takashi IwaiThe snd_es1968_tea575x_gpios table is referred as read-only, hence it can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/es1968.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/es1968.c +1 -1
@@ -2529,7 +2529,7 @@ struct snd_es1968_tea575x_gpio {char *name; }; -static struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = { +static const struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = { { .data =6 , .clk =7 , .wren =8 , .most =9 , .name ="SF64-PCE2" }, { .data =7 , .clk =8 , .wren =6 , .most =10 , .name ="M56VAP" }, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 56/58 ALSA: fm801: Constify snd_fm801_tea575x_gpios
In reply to Takashi IwaiThe snd_fm801_tea575x_gpios table is referred as read-only, hence it can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/fm801.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/fm801.c +1 -1
@@ -724,7 +724,7 @@ struct snd_fm801_tea575x_gpio {char *name; }; -static struct snd_fm801_tea575x_gpio snd_fm801_tea575x_gpios[] = { +static const struct snd_fm801_tea575x_gpio snd_fm801_tea575x_gpios[] = { { .data =1 , .clk =3 , .wren =2 , .most =0 , .name ="SF256-PCS" }, { .data =1 , .clk =0 , .wren =2 , .most =3 , .name ="SF256-PCP" }, { .data =2 , .clk =0 , .wren =1 , .most =3 , .name ="SF64-PCR" },
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 57/58 ALSA: hda: Constify snd_pci_quirk tables
In reply to Takashi IwaiThe snd_pci_quirk tables are referred as read-only, hence they can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/hda/hda_intel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/hda/hda_intel.c +4 -4
@@ -1490,7 +1490,7 @@ static bool check_hdmi_disabled(struct pci_dev *pci)/* * white/black-listing for position_fix */ -static struct snd_pci_quirk position_fix_list[] = { +static const struct snd_pci_quirk position_fix_list[] = {SND_PCI_QUIRK (0x1028 ,0x01cc ,"Dell D820" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x1028 ,0x01de ,"Dell Precision 390" ,POS_FIX_LPIB ),SND_PCI_QUIRK (0x103c ,0x306d ,"HP dv3" ,POS_FIX_LPIB ),
@@ -1583,7 +1583,7 @@ static void assign_position_fix(struct azx *chip, int fix)/* * black-lists for probe_mask */ -static struct snd_pci_quirk probe_mask_list[] = { +static const struct snd_pci_quirk probe_mask_list[] = {/* Thinkpad often breaks the controller communication when accessing * to the non-working (or non-existing) modem codec slot. */
@@ -1631,7 +1631,7 @@ static void check_probe_mask(struct azx *chip, int dev)/* * white/black-list for enable_msi */ -static struct snd_pci_quirk msi_black_list[] = { +static const struct snd_pci_quirk msi_black_list[] = {SND_PCI_QUIRK (0x103c ,0x2191 ,"HP" ,0 ),/* AMD Hudson */ SND_PCI_QUIRK (0x103c ,0x2192 ,"HP" ,0 ),/* AMD Hudson */ SND_PCI_QUIRK (0x103c ,0x21f7 ,"HP" ,0 ),/* AMD Hudson */
@@ -2164,7 +2164,7 @@ static int azx_probe(struct pci_dev *pci,* So we keep a list of devices where we disable powersaving as its known * to causes problems on these devices. */ -static struct snd_pci_quirk power_save_blacklist[] = { +static const struct snd_pci_quirk power_save_blacklist[] = {/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ SND_PCI_QUIRK (0x1849 ,0xc892 ,"Asrock B85M-ITX" ,0 ),/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 58/58 ALSA: pci: Constify snd_pci_quirk tables
In reply to Takashi IwaiThe snd_pci_quirk tables are referred as read-only, hence they can be declared as const gracefully.
There should be no functional changes by this patch.
--- sound/pci/atiixp.c | 2 +- sound/pci/ctxfi/ctatc.c | 4 ++-- sound/pci/ens1370.c | 8 ++++---- sound/pci/intel8x0.c | 6 +++--- sound/pci/maestro3.c | 8 ++++---- sound/pci/nm256/nm256.c | 2 +- sound/pci/via82xx.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-)
sound/pci/atiixp.c +1 -1
@@ -282,7 +282,7 @@ static const struct pci_device_id snd_atiixp_ids[] = {MODULE_DEVICE_TABLE (pci, snd_atiixp_ids); -static struct snd_pci_quirk atiixp_quirks[] = { +static const struct snd_pci_quirk atiixp_quirks[] = {SND_PCI_QUIRK (0x105b ,0x0c81 ,"Foxconn RC4107MA-RS2" ,0 ),SND_PCI_QUIRK (0x15bd ,0x3100 ,"DFI RS482" ,0 ), { }/* terminator */
sound/pci/ctxfi/ctatc.c +2 -2
@@ -35,7 +35,7 @@ | (0x10 << 16) \ | ((IEC958_AES3_CON_FS_48000) << 24)) -static struct snd_pci_quirk subsys_20k1_list[] = { +static const struct snd_pci_quirk subsys_20k1_list[] = {SND_PCI_QUIRK (PCI_VENDOR_ID_CREATIVE ,0x0022 ,"SB055x" ,CTSB055X ),SND_PCI_QUIRK (PCI_VENDOR_ID_CREATIVE ,0x002f ,"SB055x" ,CTSB055X ),SND_PCI_QUIRK (PCI_VENDOR_ID_CREATIVE ,0x0029 ,"SB073x" ,CTSB073X ),
@@ -45,7 +45,7 @@ static struct snd_pci_quirk subsys_20k1_list[] = { { }/* terminator */ }; -static struct snd_pci_quirk subsys_20k2_list[] = { +static const struct snd_pci_quirk subsys_20k2_list[] = {SND_PCI_QUIRK (PCI_VENDOR_ID_CREATIVE ,PCI_SUBDEVICE_ID_CREATIVE_SB0760 ,"SB0760" ,CTSB0760 ), SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB1270,
sound/pci/ens1370.c +4 -4
@@ -1562,7 +1562,7 @@ struct es1371_quirk { };static int es1371_quirk_lookup (struct ensoniq *ensoniq, -struct es1371_quirk *list) +const struct es1371_quirk *list) {while (list->vid != (unsigned short )PCI_ANY_ID ) { if (ensoniq->pci->vendor == list->vid &&
@@ -1583,7 +1583,7 @@ static struct es1371_quirk es1371_spdif_present[] = { { .vid = PCI_ANY_ID, .did = PCI_ANY_ID } }; -static struct snd_pci_quirk ens1373_line_quirk[] = { +static const struct snd_pci_quirk ens1373_line_quirk[] = {SND_PCI_QUIRK_ID (0x1274 ,0x2000 ),/* GA-7DXR */ SND_PCI_QUIRK_ID (0x1458 ,0xa000 ),/* GA-8IEXP */ { }/* end */
@@ -1909,7 +1909,7 @@ static int snd_ensoniq_dev_free(struct snd_device *device) }#ifdef CHIP1371 -static struct snd_pci_quirk es1371_amplifier_hack[] = { +static const struct snd_pci_quirk es1371_amplifier_hack[] = {SND_PCI_QUIRK_ID (0x107b ,0x2150 ),/* Gateway Solo 2150 */ SND_PCI_QUIRK_ID (0x13bd ,0x100c ),/* EV1938 on Mebius PC-MJ100V */ SND_PCI_QUIRK_ID(0x1102, 0x5938), /* Targa Xtender300 */
@@ -1917,7 +1917,7 @@ static struct snd_pci_quirk es1371_amplifier_hack[] = { { }/* end */ }; -static struct es1371_quirk es1371_ac97_reset_hack[] = { +static const struct es1371_quirk es1371_ac97_reset_hack[] = { { .vid =PCI_VENDOR_ID_ENSONIQ , .did =PCI_DEVICE_ID_ENSONIQ_CT5880 , .rev =CT5880REV_CT5880_C }, { .vid =PCI_VENDOR_ID_ENSONIQ , .did =PCI_DEVICE_ID_ENSONIQ_CT5880 , .rev =CT5880REV_CT5880_D }, { .vid =PCI_VENDOR_ID_ENSONIQ , .did =PCI_DEVICE_ID_ENSONIQ_CT5880 , .rev =CT5880REV_CT5880_E },
sound/pci/intel8x0.c +3 -3
@@ -2328,7 +2328,7 @@ static void do_ali_reset(struct intel8x0 *chip) }#ifdef CONFIG_SND_AC97_POWER_SAVE -static struct snd_pci_quirk ich_chip_reset_mode[] = { +static const struct snd_pci_quirk ich_chip_reset_mode[] = {SND_PCI_QUIRK (0x1014 ,0x051f ,"Thinkpad R32" ,1 ), { }/* end */ };
@@ -2774,7 +2774,7 @@ static void intel8x0_measure_ac97_clock(struct intel8x0 *chip)snd_ac97_update_power (chip->ac97[0 ],AC97_PCM_FRONT_DAC_RATE ,0 ); } -static struct snd_pci_quirk intel8x0_clock_list[] = { +static const struct snd_pci_quirk intel8x0_clock_list[] = {SND_PCI_QUIRK (0x0e11 ,0x008a ,"AD1885" ,41000 ),SND_PCI_QUIRK (0x1014 ,0x0581 ,"AD1981B" ,48000 ),SND_PCI_QUIRK (0x1028 ,0x00be ,"AD1885" ,44100 ),
@@ -3133,7 +3133,7 @@ static struct shortname_table { { 0, NULL }, }; -static struct snd_pci_quirk spdif_aclink_defaults[] = { +static const struct snd_pci_quirk spdif_aclink_defaults[] = {SND_PCI_QUIRK (0x147b ,0x1c1a ,"ASUS KN8" ,1 ), { }/* end */ };
sound/pci/maestro3.c +4 -4
@@ -807,7 +807,7 @@ static const struct pci_device_id snd_m3_ids[] = {MODULE_DEVICE_TABLE (pci, snd_m3_ids); -static struct snd_pci_quirk m3_amp_quirk_list[] = { +static const struct snd_pci_quirk m3_amp_quirk_list[] = {SND_PCI_QUIRK (0x0E11 ,0x0094 ,"Compaq Evo N600c" ,0x0c ),SND_PCI_QUIRK (0x10f7 ,0x833e ,"Panasonic CF-28" ,0x0d ),SND_PCI_QUIRK (0x10f7 ,0x833d ,"Panasonic CF-72" ,0x0d ),
@@ -816,7 +816,7 @@ static struct snd_pci_quirk m3_amp_quirk_list[] = { { }/* END */ }; -static struct snd_pci_quirk m3_irda_quirk_list[] = { +static const struct snd_pci_quirk m3_irda_quirk_list[] = {SND_PCI_QUIRK (0x1028 ,0x00b0 ,"Dell Inspiron 4000" ,1 ),SND_PCI_QUIRK (0x1028 ,0x00a4 ,"Dell Inspiron 8000" ,1 ),SND_PCI_QUIRK (0x1028 ,0x00e6 ,"Dell Inspiron 8100" ,1 ),
@@ -824,7 +824,7 @@ static struct snd_pci_quirk m3_irda_quirk_list[] = { };/* hardware volume quirks */ -static struct snd_pci_quirk m3_hv_quirk_list[] = { +static const struct snd_pci_quirk m3_hv_quirk_list[] = {/* Allegro chips */ SND_PCI_QUIRK (0x0E11 ,0x002E ,NULL ,HV_CTRL_ENABLE |HV_BUTTON_FROM_GD ),SND_PCI_QUIRK (0x0E11 ,0x0094 ,NULL ,HV_CTRL_ENABLE |HV_BUTTON_FROM_GD ),
@@ -902,7 +902,7 @@ static struct snd_pci_quirk m3_hv_quirk_list[] = { };/* HP Omnibook quirks */ -static struct snd_pci_quirk m3_omnibook_quirk_list[] = { +static const struct snd_pci_quirk m3_omnibook_quirk_list[] = {SND_PCI_QUIRK_ID (0x103c ,0x0010 ),/* HP OmniBook 6000 */ SND_PCI_QUIRK_ID (0x103c ,0x0011 ),/* HP OmniBook 500 */ { }/* END */
sound/pci/nm256/nm256.c +1 -1
@@ -1634,7 +1634,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,enum {NM_BLACKLISTED ,NM_RESET_WORKAROUND ,NM_RESET_WORKAROUND_2 }; -static struct snd_pci_quirk nm256_quirks[] = { +static const struct snd_pci_quirk nm256_quirks[] = {/* HP omnibook 4150 has cs4232 codec internally */ SND_PCI_QUIRK (0x103c ,0x0007 ,"HP omnibook 4150" ,NM_BLACKLISTED ),/* Reset workarounds to avoid lock-ups */
sound/pci/via82xx.c +1 -1
@@ -2417,7 +2417,7 @@ static struct via823x_info via823x_cards[] = {* auto detection of DXS channel supports. */ -static struct snd_pci_quirk dxs_whitelist[] = { +static const struct snd_pci_quirk dxs_whitelist[] = {SND_PCI_QUIRK (0x1005 ,0x4710 ,"Avance Logic Mobo" ,VIA_DXS_ENABLE ),SND_PCI_QUIRK (0x1019 ,0x0996 ,"ESC Mobo" ,VIA_DXS_48K ),SND_PCI_QUIRK (0x1019 ,0x0a81 ,"ECS K7VTA3 v8.0" ,VIA_DXS_NO_VRA ),
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel