Skip to content

Commit

Permalink
ASoC: rt1011: make array pd static const, makes object smaller
Browse files Browse the repository at this point in the history
Don't populate the array pd on the stack but instead make it
static const. Makes the object code smaller by 100 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  51463	  13016	    128	  64607	   fc5f	sound/soc/codecs/rt1011.o

After:
   text	   data	    bss	    dec	    hex	filename
  51299	  13080	    128	  64507	   fbfb	sound/soc/codecs/rt1011.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Colin Ian King authored and broonie committed Sep 9, 2019
1 parent 2458adb commit 2b70d57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/codecs/rt1011.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,8 @@ static const struct snd_soc_dapm_route rt1011_dapm_routes[] = {

static int rt1011_get_clk_info(int sclk, int rate)
{
int i, pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
int i;
static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};

if (sclk <= 0 || rate <= 0)
return -EINVAL;
Expand Down

0 comments on commit 2b70d57

Please sign in to comment.