ASoC: SOF: intel: hda: Constify snd_sof_dsp_ops
authorKrzysztof Kozlowski <krzk@kernel.org>
Fri, 26 Apr 2024 09:03:53 +0000 (11:03 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 29 Apr 2024 15:16:51 +0000 (00:16 +0900)
'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>
sound/soc/sof/intel/hda-common-ops.c
sound/soc/sof/intel/hda.h

index d71bb66b9991164cdb8b0ed000e461d9e3a0719c..466769c68da5551becbc0a4c85c31c5d3a66c0a6 100644 (file)
@@ -14,7 +14,7 @@
 #include "hda.h"
 #include "../sof-audio.h"
 
-struct snd_sof_dsp_ops sof_hda_common_ops = {
+const struct snd_sof_dsp_ops sof_hda_common_ops = {
        /* probe/remove/shutdown */
        .probe_early    = hda_dsp_probe_early,
        .probe          = hda_dsp_probe,
index b59d1a572bce339185e85d2ba7de580a9fd0a269..7804c5b50c265debddb920b7d2a877228730294c 100644 (file)
@@ -874,7 +874,7 @@ int hda_dsp_dais_suspend(struct snd_sof_dev *sdev);
 /*
  * Platform Specific HW abstraction Ops.
  */
-extern struct snd_sof_dsp_ops sof_hda_common_ops;
+extern const struct snd_sof_dsp_ops sof_hda_common_ops;
 
 extern struct snd_sof_dsp_ops sof_skl_ops;
 int sof_skl_ops_init(struct snd_sof_dev *sdev);