diff mbox series

ASoC: Intel: sst: Constify struct intel_sst_ops

Message ID 098acdf266b2f4a922d6a624e9032ec24a09093c.1719155688.git.christophe.jaillet@wanadoo.fr
State New
Headers show
Series ASoC: Intel: sst: Constify struct intel_sst_ops | expand

Commit Message

Christophe JAILLET June 23, 2024, 3:15 p.m. UTC
'struct intel_sst_ops' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  12250	   1000	    112	  13362	   3432	sound/soc/intel/atom/sst/sst.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  12378	    888	    112	  13378	   3442	sound/soc/intel/atom/sst/sst.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested-only
---
 sound/soc/intel/atom/sst/sst.c | 2 +-
 sound/soc/intel/atom/sst/sst.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index e0357d257c6c..ff03fde12151 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -158,7 +158,7 @@  static int sst_save_dsp_context_v2(struct intel_sst_drv *sst)
 }
 
 
-static struct intel_sst_ops mrfld_ops = {
+static const struct intel_sst_ops mrfld_ops = {
 	.interrupt = intel_sst_interrupt_mrfld,
 	.irq_thread = intel_sst_irq_thread_mrfld,
 	.clear_interrupt = intel_sst_clear_intr_mrfld,
diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
index 126903e126e4..e0db7434543c 100644
--- a/sound/soc/intel/atom/sst/sst.h
+++ b/sound/soc/intel/atom/sst/sst.h
@@ -391,7 +391,7 @@  struct intel_sst_drv {
 	unsigned int		csr_value;
 	void			*fw_in_mem;
 	struct sst_sg_list	fw_sg_list, library_list;
-	struct intel_sst_ops	*ops;
+	const struct intel_sst_ops	*ops;
 	struct sst_info		info;
 	struct pm_qos_request	*qos;
 	unsigned int		use_dma;