Skip to content

Commit

Permalink
staging: most: net: make array 'broadcast' static, shrinks object size
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Colin Ian King authored and gregkh committed Sep 10, 2018
1 parent 08633dc commit 93f5715
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/most/net/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 93f5715

Please sign in to comment.