Skip to content

Commit

Permalink
ALSA: pci: make snd_pcm_hardware const
Browse files Browse the repository at this point in the history
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
goyalbhumika authored and tiwai committed Aug 12, 2017
1 parent 420b0c1 commit dee4989
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions sound/pci/ad1889.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ snd_ad1889_hw_free(struct snd_pcm_substream *substream)
return snd_pcm_lib_free_pages(substream);
}

static struct snd_pcm_hardware snd_ad1889_playback_hw = {
static const struct snd_pcm_hardware snd_ad1889_playback_hw = {
.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BLOCK_TRANSFER,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
Expand All @@ -300,7 +300,7 @@ static struct snd_pcm_hardware snd_ad1889_playback_hw = {
/*.fifo_size = 0,*/
};

static struct snd_pcm_hardware snd_ad1889_capture_hw = {
static const struct snd_pcm_hardware snd_ad1889_capture_hw = {
.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BLOCK_TRANSFER,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static int snd_als300_ac97(struct snd_als300 *chip)
* the card when it is running outside of legacy
* mode.
*/
static struct snd_pcm_hardware snd_als300_playback_hw =
static const struct snd_pcm_hardware snd_als300_playback_hw =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -347,7 +347,7 @@ static struct snd_pcm_hardware snd_als300_playback_hw =
.periods_max = 2,
};

static struct snd_pcm_hardware snd_als300_capture_hw =
static const struct snd_pcm_hardware snd_als300_capture_hw =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/als4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id)

/*****************************************************************/

static struct snd_pcm_hardware snd_als4000_playback =
static const struct snd_pcm_hardware snd_als4000_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID),
Expand All @@ -611,7 +611,7 @@ static struct snd_pcm_hardware snd_als4000_playback =
.fifo_size = 0
};

static struct snd_pcm_hardware snd_als4000_capture =
static const struct snd_pcm_hardware snd_als4000_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID),
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ static int snd_atiixp_pcm_hw_free(struct snd_pcm_substream *substream)
/*
* pcm hardware definition, identical for all DMA types
*/
static struct snd_pcm_hardware snd_atiixp_pcm_hw =
static const struct snd_pcm_hardware snd_atiixp_pcm_hw =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/atiixp_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ static int snd_atiixp_pcm_hw_free(struct snd_pcm_substream *substream)
/*
* pcm hardware definition, identical for all DMA types
*/
static struct snd_pcm_hardware snd_atiixp_pcm_hw =
static const struct snd_pcm_hardware snd_atiixp_pcm_hw =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/bt87x.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static irqreturn_t snd_bt87x_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

static struct snd_pcm_hardware snd_bt87x_digital_hw = {
static const struct snd_pcm_hardware snd_bt87x_digital_hw = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand All @@ -370,7 +370,7 @@ static struct snd_pcm_hardware snd_bt87x_digital_hw = {
.periods_max = 255,
};

static struct snd_pcm_hardware snd_bt87x_analog_hw = {
static const struct snd_pcm_hardware snd_bt87x_analog_hw = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
12 changes: 6 additions & 6 deletions sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ static irqreturn_t snd_cmipci_interrupt(int irq, void *dev_id)
*/

/* playback on channel A */
static struct snd_pcm_hardware snd_cmipci_playback =
static const struct snd_pcm_hardware snd_cmipci_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
Expand All @@ -1497,7 +1497,7 @@ static struct snd_pcm_hardware snd_cmipci_playback =
};

/* capture on channel B */
static struct snd_pcm_hardware snd_cmipci_capture =
static const struct snd_pcm_hardware snd_cmipci_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
Expand All @@ -1517,7 +1517,7 @@ static struct snd_pcm_hardware snd_cmipci_capture =
};

/* playback on channel B - stereo 16bit only? */
static struct snd_pcm_hardware snd_cmipci_playback2 =
static const struct snd_pcm_hardware snd_cmipci_playback2 =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
Expand All @@ -1537,7 +1537,7 @@ static struct snd_pcm_hardware snd_cmipci_playback2 =
};

/* spdif playback on channel A */
static struct snd_pcm_hardware snd_cmipci_playback_spdif =
static const struct snd_pcm_hardware snd_cmipci_playback_spdif =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
Expand All @@ -1557,7 +1557,7 @@ static struct snd_pcm_hardware snd_cmipci_playback_spdif =
};

/* spdif playback on channel A (32bit, IEC958 subframes) */
static struct snd_pcm_hardware snd_cmipci_playback_iec958_subframe =
static const struct snd_pcm_hardware snd_cmipci_playback_iec958_subframe =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
Expand All @@ -1577,7 +1577,7 @@ static struct snd_pcm_hardware snd_cmipci_playback_iec958_subframe =
};

/* spdif capture on channel B */
static struct snd_pcm_hardware snd_cmipci_capture_spdif =
static const struct snd_pcm_hardware snd_cmipci_capture_spdif =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_PAUSE |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ static snd_pcm_uframes_t snd_cs4281_pointer(struct snd_pcm_substream *substream)
snd_cs4281_peekBA0(chip, dma->regDCC) - 1;
}

static struct snd_pcm_hardware snd_cs4281_playback =
static const struct snd_pcm_hardware snd_cs4281_playback =
{
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -872,7 +872,7 @@ static struct snd_pcm_hardware snd_cs4281_playback =
.fifo_size = CS4281_FIFO_SIZE,
};

static struct snd_pcm_hardware snd_cs4281_capture =
static const struct snd_pcm_hardware snd_cs4281_capture =
{
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
Expand Down
6 changes: 3 additions & 3 deletions sound/pci/ens1370.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ static snd_pcm_uframes_t snd_ensoniq_capture_pointer(struct snd_pcm_substream *s
return ptr;
}

static struct snd_pcm_hardware snd_ensoniq_playback1 =
static const struct snd_pcm_hardware snd_ensoniq_playback1 =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand All @@ -1086,7 +1086,7 @@ static struct snd_pcm_hardware snd_ensoniq_playback1 =
.fifo_size = 0,
};

static struct snd_pcm_hardware snd_ensoniq_playback2 =
static const struct snd_pcm_hardware snd_ensoniq_playback2 =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand All @@ -1106,7 +1106,7 @@ static struct snd_pcm_hardware snd_ensoniq_playback2 =
.fifo_size = 0,
};

static struct snd_pcm_hardware snd_ensoniq_capture =
static const struct snd_pcm_hardware snd_ensoniq_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/es1938.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ static int snd_es1938_pcm_hw_free(struct snd_pcm_substream *substream)
/* ----------------------------------------------------------------------
* Audio1 Capture (ADC)
* ----------------------------------------------------------------------*/
static struct snd_pcm_hardware snd_es1938_capture =
static const struct snd_pcm_hardware snd_es1938_capture =
{
.info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER),
Expand All @@ -922,7 +922,7 @@ static struct snd_pcm_hardware snd_es1938_capture =
/* -----------------------------------------------------------------------
* Audio2 Playback (DAC)
* -----------------------------------------------------------------------*/
static struct snd_pcm_hardware snd_es1938_playback =
static const struct snd_pcm_hardware snd_es1938_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/es1968.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ static snd_pcm_uframes_t snd_es1968_pcm_pointer(struct snd_pcm_substream *substr
return bytes_to_frames(substream->runtime, ptr % es->dma_size);
}

static struct snd_pcm_hardware snd_es1968_playback = {
static const struct snd_pcm_hardware snd_es1968_playback = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -1311,7 +1311,7 @@ static struct snd_pcm_hardware snd_es1968_playback = {
.fifo_size = 0,
};

static struct snd_pcm_hardware snd_es1968_capture = {
static const struct snd_pcm_hardware snd_es1968_capture = {
.info = (SNDRV_PCM_INFO_NONINTERLEAVED |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static irqreturn_t snd_fm801_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

static struct snd_pcm_hardware snd_fm801_playback =
static const struct snd_pcm_hardware snd_fm801_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand All @@ -619,7 +619,7 @@ static struct snd_pcm_hardware snd_fm801_playback =
.fifo_size = 0,
};

static struct snd_pcm_hardware snd_fm801_capture =
static const struct snd_pcm_hardware snd_fm801_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *subs
return bytes_to_frames(substream->runtime, ptr);
}

static struct snd_pcm_hardware snd_intel8x0_stream =
static const struct snd_pcm_hardware snd_intel8x0_stream =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/intel8x0m.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ static int snd_intel8x0m_pcm_prepare(struct snd_pcm_substream *substream)
return 0;
}

static struct snd_pcm_hardware snd_intel8x0m_stream =
static const struct snd_pcm_hardware snd_intel8x0m_stream =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ static irqreturn_t snd_m3_interrupt(int irq, void *dev_id)
/*
*/

static struct snd_pcm_hardware snd_m3_playback =
static const struct snd_pcm_hardware snd_m3_playback =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -1702,7 +1702,7 @@ static struct snd_pcm_hardware snd_m3_playback =
.periods_max = 1024,
};

static struct snd_pcm_hardware snd_m3_capture =
static const struct snd_pcm_hardware snd_m3_capture =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
Expand Down
8 changes: 4 additions & 4 deletions sound/pci/rme32.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int snd_rme32_capture_copy_kernel(struct snd_pcm_substream *substream,
/*
* SPDIF I/O capabilities (half-duplex mode)
*/
static struct snd_pcm_hardware snd_rme32_spdif_info = {
static const struct snd_pcm_hardware snd_rme32_spdif_info = {
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -340,7 +340,7 @@ static struct snd_pcm_hardware snd_rme32_spdif_info = {
/*
* ADAT I/O capabilities (half-duplex mode)
*/
static struct snd_pcm_hardware snd_rme32_adat_info =
static const struct snd_pcm_hardware snd_rme32_adat_info =
{
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
Expand All @@ -365,7 +365,7 @@ static struct snd_pcm_hardware snd_rme32_adat_info =
/*
* SPDIF I/O capabilities (full-duplex mode)
*/
static struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
static const struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -391,7 +391,7 @@ static struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
/*
* ADAT I/O capabilities (full-duplex mode)
*/
static struct snd_pcm_hardware snd_rme32_adat_fd_info =
static const struct snd_pcm_hardware snd_rme32_adat_fd_info =
{
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down
8 changes: 4 additions & 4 deletions sound/pci/rme96.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ snd_rme96_capture_copy_kernel(struct snd_pcm_substream *substream,
/*
* Digital output capabilities (S/PDIF)
*/
static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
static const struct snd_pcm_hardware snd_rme96_playback_spdif_info =
{
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down Expand Up @@ -415,7 +415,7 @@ static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
/*
* Digital input capabilities (S/PDIF)
*/
static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
static const struct snd_pcm_hardware snd_rme96_capture_spdif_info =
{
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down Expand Up @@ -446,7 +446,7 @@ static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
/*
* Digital output capabilities (ADAT)
*/
static struct snd_pcm_hardware snd_rme96_playback_adat_info =
static const struct snd_pcm_hardware snd_rme96_playback_adat_info =
{
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
Expand All @@ -473,7 +473,7 @@ static struct snd_pcm_hardware snd_rme96_playback_adat_info =
/*
* Digital input capabilities (ADAT)
*/
static struct snd_pcm_hardware snd_rme96_capture_adat_info =
static const struct snd_pcm_hardware snd_rme96_capture_adat_info =
{
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/sis7019.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct sis7019 {
* We'll add a constraint upon open that limits the period and buffer sample
* size to values that are legal for the hardware.
*/
static struct snd_pcm_hardware sis_playback_hw_info = {
static const struct snd_pcm_hardware sis_playback_hw_info = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
Expand All @@ -180,7 +180,7 @@ static struct snd_pcm_hardware sis_playback_hw_info = {
.periods_max = (0xfff9 / 9),
};

static struct snd_pcm_hardware sis_capture_hw_info = {
static const struct snd_pcm_hardware sis_capture_hw_info = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/sonicvibes.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ static snd_pcm_uframes_t snd_sonicvibes_capture_pointer(struct snd_pcm_substream
return bytes_to_frames(substream->runtime, ptr);
}

static struct snd_pcm_hardware snd_sonicvibes_playback =
static const struct snd_pcm_hardware snd_sonicvibes_playback =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand All @@ -795,7 +795,7 @@ static struct snd_pcm_hardware snd_sonicvibes_playback =
.fifo_size = 0,
};

static struct snd_pcm_hardware snd_sonicvibes_capture =
static const struct snd_pcm_hardware snd_sonicvibes_capture =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/via82xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ static int snd_via8233_capture_prepare(struct snd_pcm_substream *substream)
/*
* pcm hardware definition, identical for both playback and capture
*/
static struct snd_pcm_hardware snd_via82xx_hw =
static const struct snd_pcm_hardware snd_via82xx_hw =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
Expand Down
Loading

0 comments on commit dee4989

Please sign in to comment.