drm/mgag200: make array m_div_val static, shrinks object size

Submitted by Colin King on Nov. 29, 2018, 11:40 p.m.

Details

Message ID 20181129234051.5463-1-colin.king@canonical.com
State New
Headers show
Series "drm/mgag200: make array m_div_val static, shrinks object size" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Colin King Nov. 29, 2018, 11:40 p.m.
From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array m_div_val on 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	   8513	mgag200/mgag200_mode.o

After:
   text	   data	    bss	    dec	    hex	filename
  32215	   1792	      0	  34007	   84d7	mgag200/mgag200_mode.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index acf7bfe68454..9939f0174bf7 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -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 };
 
 	m = n = p = 0;
 	vcomax = 1488000;