提交 57f7feff 编写于 作者: C Colin Ian King 提交者: Mark Brown

ASoC: rl6231: make arrays div and pd static const, reduces object code size

Don't populate the read-only arrays div and pd on the stack,
instead make them static const. Makes the object code smaller by 210 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   2869	    720	      0	   3589	    e05	sound/soc/codecs/rl6231.o

After:
   text	   data	    bss	    dec	    hex	filename
   2495	    880	      0	   3375	    d2f	sound/soc/codecs/rl6231.o
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 2bd6bf03
...@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(rl6231_get_pre_div); ...@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(rl6231_get_pre_div);
*/ */
int rl6231_calc_dmic_clk(int rate) int rl6231_calc_dmic_clk(int rate)
{ {
int div[] = {2, 3, 4, 6, 8, 12}; static const int div[] = {2, 3, 4, 6, 8, 12};
int i; int i;
if (rate < 1000000 * div[0]) { if (rate < 1000000 * div[0]) {
...@@ -189,7 +189,8 @@ EXPORT_SYMBOL_GPL(rl6231_pll_calc); ...@@ -189,7 +189,8 @@ EXPORT_SYMBOL_GPL(rl6231_pll_calc);
int rl6231_get_clk_info(int sclk, int rate) int rl6231_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) if (sclk <= 0 || rate <= 0)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册