Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240429-n-asoc-const-snd-pcm-hardware-v1-3-c6ce60989834@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
7b5ce9f0 ed901560

+4 -4
+1 -1
sound/soc/meson/aiu-fifo-i2s.c
··· 25 25 26 26 #define AIU_FIFO_I2S_BLOCK 256 27 27 28 - static struct snd_pcm_hardware fifo_i2s_pcm = { 28 + static const struct snd_pcm_hardware fifo_i2s_pcm = { 29 29 .info = (SNDRV_PCM_INFO_INTERLEAVED | 30 30 SNDRV_PCM_INFO_MMAP | 31 31 SNDRV_PCM_INFO_MMAP_VALID |
+1 -1
sound/soc/meson/aiu-fifo-spdif.c
··· 27 27 28 28 #define AIU_FIFO_SPDIF_BLOCK 8 29 29 30 - static struct snd_pcm_hardware fifo_spdif_pcm = { 30 + static const struct snd_pcm_hardware fifo_spdif_pcm = { 31 31 .info = (SNDRV_PCM_INFO_INTERLEAVED | 32 32 SNDRV_PCM_INFO_MMAP | 33 33 SNDRV_PCM_INFO_MMAP_VALID |
+1 -1
sound/soc/meson/aiu-fifo.h
··· 18 18 struct platform_device; 19 19 20 20 struct aiu_fifo { 21 - struct snd_pcm_hardware *pcm; 21 + const struct snd_pcm_hardware *pcm; 22 22 unsigned int mem_offset; 23 23 unsigned int fifo_block; 24 24 struct clk *pclk;
+1 -1
sound/soc/meson/axg-fifo.c
··· 23 23 * These differences are handled in the respective DAI drivers 24 24 */ 25 25 26 - static struct snd_pcm_hardware axg_fifo_hw = { 26 + static const struct snd_pcm_hardware axg_fifo_hw = { 27 27 .info = (SNDRV_PCM_INFO_INTERLEAVED | 28 28 SNDRV_PCM_INFO_MMAP | 29 29 SNDRV_PCM_INFO_MMAP_VALID |