Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream/test const #4993

Closed

Conversation

plbossart
Copy link
Member

No description provided.

snd_soc_tplg_component_load() does not modify its "*ops" argument. It
only read some values and stores it in "soc_tplg.ops".

This argument and the ops field in "struct soc_tplg" can be made const.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Constifying "struct snd_soc_tplg_ops" 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
  28046	    794	      0	  28840	   70a8	sound/soc/intel/avs/topology.o

After:
   text	   data	    bss	    dec	    hex	filename
  28206	    614	      0	  28820	   7094	sound/soc/intel/avs/topology.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Constifying "struct snd_soc_tplg_ops" 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
  19942	    832	      0	  20774	   5126	sound/soc/qcom/qdsp6/topology.o

After:
   text	   data	    bss	    dec	    hex	filename
  20102	    652	      0	  20754	   5112	sound/soc/qcom/qdsp6/topology.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Constifying "struct snd_soc_tplg_ops" 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
  58844	   5282	     56	  64182	   fab6	sound/soc/intel/skylake/skl-topology.o

After:
   text	   data	    bss	    dec	    hex	filename
  59004	   5122	     56	  64182	   fab6	sound/soc/intel/skylake/skl-topology.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Constifying "struct snd_soc_tplg_ops" 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
  44519	   2888	     48	  47455	   b95f	sound/soc/sof/topology.o

After:
   text	   data	    bss	    dec	    hex	filename
  44839	   2552	     48	  47439	   b94f	sound/soc/sof/topology.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Now that the soc-topology can handle "const struct snd_soc_tplg_ops" make
sure that new usages of the struct already enter the tree as const.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Constifying "struct snd_soc_ops" moves some data to a read-only section, so
increase overall security.

This structure is also part of scripts/const_structs.checkpatch.

As an example, on a x86_64, with allmodconfig:
Before:
   text	   data	    bss	    dec	    hex	filename
   6315	   3696	      0	  10011	   271b	sound/soc/intel/boards/ehl_rt5660.o

After:
   text	   data	    bss	    dec	    hex	filename
   6379	   3648	      0	  10027	   272b	sound/soc/intel/boards/ehl_rt5660.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants