All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: most: net: make array 'broadcast' static, shrinks object size
@ 2018-09-04 15:47 ` Colin King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin King @ 2018-09-04 15:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Christian Gromm, George Edward Bulmer, devel
  Cc: kernel-janitors, linux-kernel

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

Don't populate the array 'broadcast' on the stack but instead make it
static. Makes the object code smaller by 53 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  10511	   1521	    448	  12480	   30c0	drivers/staging/most/net/net.o

After:
   text	   data	    bss	    dec	    hex	filename
  10394	   1585	    448	  12427	   308b	drivers/staging/most/net/net.o

(gcc version 8.2.0 x86_64)

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

diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 30d816b7e165..e20584b1b112 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -75,7 +75,7 @@ static struct core_component comp;
 static int skb_to_mamac(const struct sk_buff *skb, struct mbo *mbo)
 {
 	u8 *buff = mbo->virt_address;
-	const u8 broadcast[] = { 0x03, 0xFF };
+	static const u8 broadcast[] = { 0x03, 0xFF };
 	const u8 *dest_addr = skb->data + 4;
 	const u8 *eth_type = skb->data + 12;
 	unsigned int payload_len = skb->len - ETH_HLEN;
-- 
2.17.1


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

* [PATCH] staging: most: net: make array 'broadcast' static, shrinks object size
@ 2018-09-04 15:47 ` Colin King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin King @ 2018-09-04 15:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Christian Gromm, George Edward Bulmer, devel
  Cc: kernel-janitors, linux-kernel

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

Don't populate the array 'broadcast' on the stack but instead make it
static. Makes the object code smaller by 53 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  10511	   1521	    448	  12480	   30c0	drivers/staging/most/net/net.o

After:
   text	   data	    bss	    dec	    hex	filename
  10394	   1585	    448	  12427	   308b	drivers/staging/most/net/net.o

(gcc version 8.2.0 x86_64)

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

diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 30d816b7e165..e20584b1b112 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -75,7 +75,7 @@ static struct core_component comp;
 static int skb_to_mamac(const struct sk_buff *skb, struct mbo *mbo)
 {
 	u8 *buff = mbo->virt_address;
-	const u8 broadcast[] = { 0x03, 0xFF };
+	static const u8 broadcast[] = { 0x03, 0xFF };
 	const u8 *dest_addr = skb->data + 4;
 	const u8 *eth_type = skb->data + 12;
 	unsigned int payload_len = skb->len - ETH_HLEN;
-- 
2.17.1

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

end of thread, other threads:[~2018-09-04 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 15:47 [PATCH] staging: most: net: make array 'broadcast' static, shrinks object size Colin King
2018-09-04 15:47 ` Colin 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.