diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-19 17:50:00 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-09-19 18:00:45 -0400 |
commit | 57f7feff2912d6996b5f3fcac084308ce195127c (patch) | |
tree | b87c8007108853e034d5a843599e61a8083f046a | |
parent | 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff) |
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: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/rl6231.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/codecs/rl6231.c b/sound/soc/codecs/rl6231.c index 7b447d0b173a..974a9040651d 100644 --- a/sound/soc/codecs/rl6231.c +++ b/sound/soc/codecs/rl6231.c | |||
@@ -71,7 +71,7 @@ EXPORT_SYMBOL_GPL(rl6231_get_pre_div); | |||
71 | */ | 71 | */ |
72 | int rl6231_calc_dmic_clk(int rate) | 72 | int rl6231_calc_dmic_clk(int rate) |
73 | { | 73 | { |
74 | int div[] = {2, 3, 4, 6, 8, 12}; | 74 | static const int div[] = {2, 3, 4, 6, 8, 12}; |
75 | int i; | 75 | int i; |
76 | 76 | ||
77 | if (rate < 1000000 * div[0]) { | 77 | if (rate < 1000000 * div[0]) { |
@@ -189,7 +189,8 @@ EXPORT_SYMBOL_GPL(rl6231_pll_calc); | |||
189 | 189 | ||
190 | int rl6231_get_clk_info(int sclk, int rate) | 190 | int rl6231_get_clk_info(int sclk, int rate) |
191 | { | 191 | { |
192 | int i, pd[] = {1, 2, 3, 4, 6, 8, 12, 16}; | 192 | int i; |
193 | static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16}; | ||
193 | 194 | ||
194 | if (sclk <= 0 || rate <= 0) | 195 | if (sclk <= 0 || rate <= 0) |
195 | return -EINVAL; | 196 | return -EINVAL; |