ASoC: meson: Constify static snd_pcm_hardware
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 29 Apr 2024 11:48:48 +0000 (13:48 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 6 May 2024 15:00:22 +0000 (00:00 +0900)
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>
sound/soc/meson/aiu-fifo-i2s.c
sound/soc/meson/aiu-fifo-spdif.c
sound/soc/meson/aiu-fifo.h
sound/soc/meson/axg-fifo.c

index 7d833500c799306e80b6d717a5b3653aeb23ebac..eccbc16b293ade01ab80440118e1a4f1cba25796 100644 (file)
@@ -25,7 +25,7 @@
 
 #define AIU_FIFO_I2S_BLOCK             256
 
-static struct snd_pcm_hardware fifo_i2s_pcm = {
+static const struct snd_pcm_hardware fifo_i2s_pcm = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED |
                 SNDRV_PCM_INFO_MMAP |
                 SNDRV_PCM_INFO_MMAP_VALID |
index fa91f3c53fa4628a25a80194fe418cc50b7a2500..e0e00ec026dcc478c014d7771f9aead9fc003f0b 100644 (file)
@@ -27,7 +27,7 @@
 
 #define AIU_FIFO_SPDIF_BLOCK                   8
 
-static struct snd_pcm_hardware fifo_spdif_pcm = {
+static const struct snd_pcm_hardware fifo_spdif_pcm = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED |
                 SNDRV_PCM_INFO_MMAP |
                 SNDRV_PCM_INFO_MMAP_VALID |
index 42ce266677cc867dc1057f2ced9b589d1aad223b..84ab4577815a4977f19701da41f24e2dd3566d04 100644 (file)
@@ -18,7 +18,7 @@ struct snd_pcm_hw_params;
 struct platform_device;
 
 struct aiu_fifo {
-       struct snd_pcm_hardware *pcm;
+       const struct snd_pcm_hardware *pcm;
        unsigned int mem_offset;
        unsigned int fifo_block;
        struct clk *pclk;
index bebee0ca8e3889a920a486b01c1a8730eb1988d4..633fd971b4447e58fbd5d7791932faafd308e95f 100644 (file)
@@ -23,7 +23,7 @@
  * These differences are handled in the respective DAI drivers
  */
 
-static struct snd_pcm_hardware axg_fifo_hw = {
+static const struct snd_pcm_hardware axg_fifo_hw = {
        .info = (SNDRV_PCM_INFO_INTERLEAVED |
                 SNDRV_PCM_INFO_MMAP |
                 SNDRV_PCM_INFO_MMAP_VALID |