Skip to content

Commit 6032eef

Browse files
krzkbroonie
authored andcommitted
ASoC: SOF: intel: hda: 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-6-e553fe67ae82@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8f2b0d5 commit 6032eef

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/sof/intel/hda-common-ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "hda.h"
1515
#include "../sof-audio.h"
1616

17-
struct snd_sof_dsp_ops sof_hda_common_ops = {
17+
const struct snd_sof_dsp_ops sof_hda_common_ops = {
1818
/* probe/remove/shutdown */
1919
.probe_early = hda_dsp_probe_early,
2020
.probe = hda_dsp_probe,

sound/soc/sof/intel/hda.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ int hda_dsp_dais_suspend(struct snd_sof_dev *sdev);
874874
/*
875875
* Platform Specific HW abstraction Ops.
876876
*/
877-
extern struct snd_sof_dsp_ops sof_hda_common_ops;
877+
extern const struct snd_sof_dsp_ops sof_hda_common_ops;
878878

879879
extern struct snd_sof_dsp_ops sof_skl_ops;
880880
int sof_skl_ops_init(struct snd_sof_dev *sdev);

0 commit comments

Comments
 (0)