drm/mgag200: make array m_div_val static, shrinks object size
Am 30.11.2018 00:40, schrieb Colin King:
Quoted 26 lines
From: Colin Ian King <[email protected]>
Don't populate the const array
m_div_valon the stack but instead make it static. Makes the object code smaller by 60 bytes:Before:
text data bss dec hex filename
32339 1728 0 34067 8513mgag200/mgag200_mode.oAfter:
text data bss dec hex filename
32215 1792 0 34007 84d7mgag200/mgag200_mode.o(gcc version 8.2.0
x86_64)Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/mgag200/mgag200_mode.c +0
-0
drivers/gpu/drm/mgag200/mgag200_mode.c static int mga_g200er_set_plls(struct mga_device *mdev, · line 633
Quoted 6 lines
drivers/gpu/drm/mgag200/mgag200_mode.c +1
-1@@ -629,7 +629,7 @@ static int mga_g200er_set_plls(struct mga_device *mdev, long clock)unsigned int p, m, n;unsigned int computed, vco;int tmp; -const unsigned int m_div_val[] = {1 ,2 ,4 ,8 }; +static const unsigned int m_div_val[] = {1 ,2 ,4 ,8 };
hi,
is that array needed at all ? obvious it is 2^n i found only one use:
computed = vco / (m_div_val[testm] * (testo + 1));
just my 2 cents,
re,
wh
Quoted 3 lines
drivers/gpu/drm/mgag200/mgag200_mode.c +0
-0m = n = p =0 ; vcomax =1488000 ;