Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: stw481x: Make three arrays static const, reduces object code size

Don't populate the arrays vcore_val, vpll_val and vaux_val on the
stack, instead make them static const. Makes the object code smaller
by over 370 bytes:

Before:
text data bss dec hex filename
6971 3248 64 10283 282b drivers/mfd/stw481x.o

After:
text data bss dec hex filename
6338 3504 64 9906 26b2 drivers/mfd/stw481x.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Colin Ian King and committed by
Lee Jones
223fd9f6 511cb174

+6 -4
+6 -4
drivers/mfd/stw481x.c
··· 72 72 static int stw481x_startup(struct stw481x *stw481x) 73 73 { 74 74 /* Voltages multiplied by 100 */ 75 - u8 vcore_val[] = { 100, 105, 110, 115, 120, 122, 124, 126, 128, 76 - 130, 132, 134, 136, 138, 140, 145 }; 77 - u8 vpll_val[] = { 105, 120, 130, 180 }; 78 - u8 vaux_val[] = { 15, 18, 25, 28 }; 75 + static const u8 vcore_val[] = { 76 + 100, 105, 110, 115, 120, 122, 124, 126, 128, 77 + 130, 132, 134, 136, 138, 140, 145 78 + }; 79 + static const u8 vpll_val[] = { 105, 120, 130, 180 }; 80 + static const u8 vaux_val[] = { 15, 18, 25, 28 }; 79 81 u8 vcore; 80 82 u8 vcore_slp; 81 83 u8 vpll;