ASoC: codecs: ad193x: make two arrays static const, makes object smaller
authorColin Ian King <colin.king@canonical.com>
Fri, 6 Sep 2019 16:14:04 +0000 (17:14 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 9 Sep 2019 09:50:51 +0000 (10:50 +0100)
Don't populate the arrays on the stack but instead make them
static const. Makes the object code smaller by 37 bytes.

Before:
   text    data     bss     dec     hex filename
  16253    7200       0   23453    5b9d sound/soc/codecs/ad193x.o

After:
   text    data     bss     dec     hex filename
  16056    7360       0   23416    5b78 sound/soc/codecs/ad193x.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190906161404.1440-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/ad193x.c

index fb04c9379b71e5e7a1416497f9eca0fa734d8959..980e024a5720d19fbed54202d17df0f516c2e5ad 100644 (file)
@@ -416,7 +416,7 @@ static struct snd_soc_dai_driver ad193x_no_adc_dai = {
 /* codec register values to set after reset */
 static void ad193x_reg_default_init(struct ad193x_priv *ad193x)
 {
-       const struct reg_sequence reg_init[] = {
+       static const struct reg_sequence reg_init[] = {
                {  0, 0x99 },   /* PLL_CLK_CTRL0: pll input: mclki/xi 12.288Mhz */
                {  1, 0x04 },   /* PLL_CLK_CTRL1: no on-chip Vref */
                {  2, 0x40 },   /* DAC_CTRL0: TDM mode */
@@ -432,7 +432,7 @@ static void ad193x_reg_default_init(struct ad193x_priv *ad193x)
                { 12, 0x00 },   /* DAC_L4_VOL: no attenuation */
                { 13, 0x00 },   /* DAC_R4_VOL: no attenuation */
        };
-       const struct reg_sequence reg_adc_init[] = {
+       static const struct reg_sequence reg_adc_init[] = {
                { 14, 0x03 },   /* ADC_CTRL0: high-pass filter enable */
                { 15, 0x43 },   /* ADC_CTRL1: sata delay=1, adc aux mode */
                { 16, 0x00 },   /* ADC_CTRL2: reset */