All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/platform/intel-mid: make several arrays static, makes code smaller
@ 2017-08-25 16:32 ` Colin King
  0 siblings, 0 replies; 11+ messages in thread
From: Colin King @ 2017-08-25 16:32 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, Lukas Wunner,
	Bjorn Helgaas
  Cc: kernel-janitors, Andy Shevchenko, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate arrays on the stack, instead make them static .
Makes the object code smaller by 76 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   4217	   1540	    128	   5885	   16fd	arch/x86/platform/intel-mid/pwr.o

After:
   text	   data	    bss	    dec	    hex	filename
   3981	   1700	    128	   5809	   16b1	arch/x86/platform/intel-mid/pwr.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 arch/x86/platform/intel-mid/pwr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c
index ef03852ea6e8..49ec5b94c71f 100644
--- a/arch/x86/platform/intel-mid/pwr.c
+++ b/arch/x86/platform/intel-mid/pwr.c
@@ -444,7 +444,7 @@ static int mid_set_initial_state(struct mid_pwr *pwr, const u32 *states)
 static int pnw_set_initial_state(struct mid_pwr *pwr)
 {
 	/* On Penwell SRAM must stay powered on */
-	const u32 states[] = {
+	static const u32 states[] = {
 		0xf00fffff,		/* PM_SSC(0) */
 		0xffffffff,		/* PM_SSC(1) */
 		0xffffffff,		/* PM_SSC(2) */
@@ -455,7 +455,7 @@ static int pnw_set_initial_state(struct mid_pwr *pwr)
 
 static int tng_set_initial_state(struct mid_pwr *pwr)
 {
-	const u32 states[] = {
+	static const u32 states[] = {
 		0xffffffff,		/* PM_SSC(0) */
 		0xffffffff,		/* PM_SSC(1) */
 		0xffffffff,		/* PM_SSC(2) */
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-08-29 13:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25 16:32 [PATCH] x86/platform/intel-mid: make several arrays static, makes code smaller Colin King
2017-08-25 16:32 ` Colin King
2017-08-25 16:53 ` Andy Shevchenko
2017-08-25 16:53   ` Andy Shevchenko
2017-08-25 17:51 ` Lukas Wunner
2017-08-25 17:51   ` Lukas Wunner
2017-08-25 17:53   ` Andy Shevchenko
2017-08-25 17:53     ` Andy Shevchenko
2017-08-25 18:13     ` Colin Ian King
2017-08-25 18:13       ` Colin Ian King
2017-08-29 13:06 ` [tip:x86/platform] x86/platform/intel-mid: Make several arrays static, to make " tip-bot for Colin Ian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.