Skip to content

Commit e6fa350

Browse files
krzkbroonie
authored andcommitted
ASoC: qcom: 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-1-c6ce60989834@linaro.org Signed-off-by: Mark Brown <[email protected]>
1 parent ba2a2c3 commit e6fa350

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct q6apm_dai_data {
8585
long long sid;
8686
};
8787

88-
static struct snd_pcm_hardware q6apm_dai_hardware_capture = {
88+
static const struct snd_pcm_hardware q6apm_dai_hardware_capture = {
8989
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRANSFER |
9090
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED |
9191
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
@@ -104,7 +104,7 @@ static struct snd_pcm_hardware q6apm_dai_hardware_capture = {
104104
.fifo_size = 0,
105105
};
106106

107-
static struct snd_pcm_hardware q6apm_dai_hardware_playback = {
107+
static const struct snd_pcm_hardware q6apm_dai_hardware_playback = {
108108
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_BLOCK_TRANSFER |
109109
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED |
110110
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 |

0 commit comments

Comments
 (0)