Skip to content

Commit 04f2f51

Browse files
krzkbroonie
authored andcommitted
ASoC: SOF: amd: acp: Constify snd_sof_dsp_ops
'struct snd_sof_dsp_ops' is not modified by core code, so it can be made const for increased code safety. Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240426-n-const-ops-var-v2-7-e553fe67ae82@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6032eef commit 04f2f51

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/sof/amd/acp-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev)
193193
}
194194

195195
/* AMD Common DSP ops */
196-
struct snd_sof_dsp_ops sof_acp_common_ops = {
196+
const struct snd_sof_dsp_ops sof_acp_common_ops = {
197197
/* probe and remove */
198198
.probe = amd_sof_acp_probe,
199199
.remove = amd_sof_acp_remove,

sound/soc/sof/amd/acp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substr
310310
snd_pcm_uframes_t acp_pcm_pointer(struct snd_sof_dev *sdev,
311311
struct snd_pcm_substream *substream);
312312

313-
extern struct snd_sof_dsp_ops sof_acp_common_ops;
313+
extern const struct snd_sof_dsp_ops sof_acp_common_ops;
314314

315315
extern struct snd_sof_dsp_ops sof_renoir_ops;
316316
int sof_renoir_ops_init(struct snd_sof_dev *sdev);

0 commit comments

Comments
 (0)