Skip to content

Commit

Permalink
ASoC: rt1318: Constify struct reg_sequence
Browse files Browse the repository at this point in the history
'struct reg_sequence' is not modified in this driver.

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

While at it, remove rt1318_INIT_REG_LEN which is ununsed.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  22062	   4859	     32	  26953	   6949	sound/soc/codecs/rt1318.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  24742	   2171	     32	  26945	   6941	sound/soc/codecs/rt1318.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/96561dd2962d4312eb0e68ab850027f44350d070.1722952334.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Mark Brown committed Aug 13, 2024
1 parent 6024b86 commit ab73c7c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/soc/codecs/rt1318.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "rt1318.h"

static struct reg_sequence init_list[] = {
static const struct reg_sequence init_list[] = {
{ 0x0000C000, 0x01},
{ 0x0000F20D, 0x00},
{ 0x0000F212, 0x3E},
Expand Down Expand Up @@ -254,7 +254,6 @@ static struct reg_sequence init_list[] = {
{ 0x0000C320, 0x20},
{ 0x0000C203, 0x9C},
};
#define rt1318_INIT_REG_LEN ARRAY_SIZE(init_list)

static const struct reg_default rt1318_reg[] = {
{ 0xc000, 0x00 },
Expand Down

0 comments on commit ab73c7c

Please sign in to comment.