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>
This commit is contained in:
Colin Ian King 2017-09-05 12:27:12 +01:00 committed by Lee Jones
parent 511cb17448
commit 223fd9f61f
1 changed files with 6 additions and 4 deletions

View File

@ -72,10 +72,12 @@ static int stw481x_get_pctl_reg(struct stw481x *stw481x, u8 reg)
static int stw481x_startup(struct stw481x *stw481x) static int stw481x_startup(struct stw481x *stw481x)
{ {
/* Voltages multiplied by 100 */ /* Voltages multiplied by 100 */
u8 vcore_val[] = { 100, 105, 110, 115, 120, 122, 124, 126, 128, static const u8 vcore_val[] = {
130, 132, 134, 136, 138, 140, 145 }; 100, 105, 110, 115, 120, 122, 124, 126, 128,
u8 vpll_val[] = { 105, 120, 130, 180 }; 130, 132, 134, 136, 138, 140, 145
u8 vaux_val[] = { 15, 18, 25, 28 }; };
static const u8 vpll_val[] = { 105, 120, 130, 180 };
static const u8 vaux_val[] = { 15, 18, 25, 28 };
u8 vcore; u8 vcore;
u8 vcore_slp; u8 vcore_slp;
u8 vpll; u8 vpll;