Skip to content

Commit 7b5ce9f

Browse files
krzkbroonie
authored andcommitted
ASoC: meson: Constify static snd_pcm_hardware
Static 'struct snd_pcm_hardware' is not modified by the driver and its copy is passed to the core, so it can be made const for increased code safety. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/20240429-n-asoc-const-snd-pcm-hardware-v1-3-c6ce60989834@linaro.org Signed-off-by: Mark Brown <[email protected]>
1 parent ed90156 commit 7b5ce9f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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 |

0 commit comments

Comments
 (0)