Skip to content

Commit 8051360

Browse files
committed
ASoC: Constify static snd_pcm_hardware
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Static 'struct snd_pcm_hardware' is not modified by few drivers and its copy is passed to the core, so it can be made const for increased code safety.
2 parents 741e987 + 74a15fa commit 8051360

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

sound/soc/fsl/imx-pcm-rpmsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "fsl_rpmsg.h"
1717
#include "imx-pcm-rpmsg.h"
1818

19-
static struct snd_pcm_hardware imx_rpmsg_pcm_hardware = {
19+
static const struct snd_pcm_hardware imx_rpmsg_pcm_hardware = {
2020
.info = SNDRV_PCM_INFO_INTERLEAVED |
2121
SNDRV_PCM_INFO_BLOCK_TRANSFER |
2222
SNDRV_PCM_INFO_BATCH |

sound/soc/meson/aiu-fifo-i2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#define AIU_FIFO_I2S_BLOCK 256
2727

28-
static struct snd_pcm_hardware fifo_i2s_pcm = {
28+
static const struct snd_pcm_hardware fifo_i2s_pcm = {
2929
.info = (SNDRV_PCM_INFO_INTERLEAVED |
3030
SNDRV_PCM_INFO_MMAP |
3131
SNDRV_PCM_INFO_MMAP_VALID |

sound/soc/meson/aiu-fifo-spdif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#define AIU_FIFO_SPDIF_BLOCK 8
2929

30-
static struct snd_pcm_hardware fifo_spdif_pcm = {
30+
static const struct snd_pcm_hardware fifo_spdif_pcm = {
3131
.info = (SNDRV_PCM_INFO_INTERLEAVED |
3232
SNDRV_PCM_INFO_MMAP |
3333
SNDRV_PCM_INFO_MMAP_VALID |

sound/soc/meson/aiu-fifo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct snd_pcm_hw_params;
1818
struct platform_device;
1919

2020
struct aiu_fifo {
21-
struct snd_pcm_hardware *pcm;
21+
const struct snd_pcm_hardware *pcm;
2222
unsigned int mem_offset;
2323
unsigned int fifo_block;
2424
struct clk *pclk;

sound/soc/meson/axg-fifo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* These differences are handled in the respective DAI drivers
2424
*/
2525

26-
static struct snd_pcm_hardware axg_fifo_hw = {
26+
static const struct snd_pcm_hardware axg_fifo_hw = {
2727
.info = (SNDRV_PCM_INFO_INTERLEAVED |
2828
SNDRV_PCM_INFO_MMAP |
2929
SNDRV_PCM_INFO_MMAP_VALID |

sound/soc/qcom/qdsp6/q6apm-dai.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct q6apm_dai_data {
8181
long long sid;
8282
};
8383

84-
static struct snd_pcm_hardware q6apm_dai_hardware_capture = {
84+
static const struct snd_pcm_hardware q6apm_dai_hardware_capture = {
8585
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRANSFER |
8686
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED |
8787
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
@@ -100,7 +100,7 @@ static struct snd_pcm_hardware q6apm_dai_hardware_capture = {
100100
.fifo_size = 0,
101101
};
102102

103-
static struct snd_pcm_hardware q6apm_dai_hardware_playback = {
103+
static const struct snd_pcm_hardware q6apm_dai_hardware_playback = {
104104
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRANSFER |
105105
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED |
106106
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |

sound/soc/qcom/qdsp6/q6asm-dai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_capture = {
103103
.fifo_size = 0,
104104
};
105105

106-
static struct snd_pcm_hardware q6asm_dai_hardware_playback = {
106+
static const struct snd_pcm_hardware q6asm_dai_hardware_playback = {
107107
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BATCH |
108108
SNDRV_PCM_INFO_BLOCK_TRANSFER |
109109
SNDRV_PCM_INFO_MMAP_VALID |

sound/soc/uniphier/aio-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "aio.h"
1616

17-
static struct snd_pcm_hardware uniphier_aiodma_hw = {
17+
static const struct snd_pcm_hardware uniphier_aiodma_hw = {
1818
.info = SNDRV_PCM_INFO_MMAP |
1919
SNDRV_PCM_INFO_MMAP_VALID |
2020
SNDRV_PCM_INFO_INTERLEAVED,

0 commit comments

Comments
 (0)