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

video: fbdev: aty: make const arrays static, reduces object code size

Don't populate the const arrays ragepro_tbl and ragexl_tbl on the stack,
instead make them static. Makes the object code smaller by over 380 bytes:

Before:
text data bss dec hex filename
41089 10592 768 52449 cce1 atyfb_base.o

After:
text data bss dec hex filename
40544 10752 768 52064 cb60 atyfb_base.o

(gcc version 7.2.0, x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Colin Ian King and committed by
Bartlomiej Zolnierkiewicz
160d9a6b 0619d9e8

+2 -2
+2 -2
drivers/video/fbdev/aty/atyfb_base.c
··· 2272 2272 2273 2273 static void aty_calc_mem_refresh(struct atyfb_par *par, int xclk) 2274 2274 { 2275 - const int ragepro_tbl[] = { 2275 + static const int ragepro_tbl[] = { 2276 2276 44, 50, 55, 66, 75, 80, 100 2277 2277 }; 2278 - const int ragexl_tbl[] = { 2278 + static const int ragexl_tbl[] = { 2279 2279 50, 66, 75, 83, 90, 95, 100, 105, 2280 2280 110, 115, 120, 125, 133, 143, 166 2281 2281 };