Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684961 > unrolled thread

[PATCH] net: broadcom: bnx2x: make a couple of const arrays static

Started byColin King <colin.king@canonical.com>
First post2017-07-11 13:00 +0200
Last post2017-07-13 18:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: broadcom: bnx2x: make a couple of const arrays static Colin King <colin.king@canonical.com> - 2017-07-11 13:00 +0200
    RE: [PATCH] net: broadcom: bnx2x: make a couple of const arrays  static "Mintz, Yuval" <Yuval.Mintz@cavium.com> - 2017-07-12 15:50 +0200
    Re: [PATCH] net: broadcom: bnx2x: make a couple of const arrays  static David Miller <davem@davemloft.net> - 2017-07-13 18:30 +0200

#1684961 — [PATCH] net: broadcom: bnx2x: make a couple of const arrays static

FromColin King <colin.king@canonical.com>
Date2017-07-11 13:00 +0200
Subject[PATCH] net: broadcom: bnx2x: make a couple of const arrays static
Message-ID<u213A-1g3-9@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

Don't populate various tables on the stack but make them static const.
Makes the object code smaller by nearly 200 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
 113468	  11200	      0	 124668	  1e6fc	bnx2x_ethtool.o

After:
   text	   data	    bss	    dec	    hex	filename
 113129	  11344	      0	 124473	  1e639	bnx2x_ethtool.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 43423744fdfa..21bc4bed6b26 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -2886,7 +2886,7 @@ static int bnx2x_test_nvram_tbl(struct bnx2x *bp,
 
 static int bnx2x_test_nvram(struct bnx2x *bp)
 {
-	const struct crc_pair nvram_tbl[] = {
+	static const struct crc_pair nvram_tbl[] = {
 		{     0,  0x14 }, /* bootstrap */
 		{  0x14,  0xec }, /* dir */
 		{ 0x100, 0x350 }, /* manuf_info */
@@ -2895,7 +2895,7 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
 		{ 0x708,  0x70 }, /* manuf_key_info */
 		{     0,     0 }
 	};
-	const struct crc_pair nvram_tbl2[] = {
+	static const struct crc_pair nvram_tbl2[] = {
 		{ 0x7e8, 0x350 }, /* manuf_info2 */
 		{ 0xb38,  0xf0 }, /* feature_info */
 		{     0,     0 }
-- 
2.11.0

[toc] | [next] | [standalone]


#1685788 — RE: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static

From"Mintz, Yuval" <Yuval.Mintz@cavium.com>
Date2017-07-12 15:50 +0200
SubjectRE: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
Message-ID<u2qbE-pT-19@gated-at.bofh.it>
In reply to#1684961
> Don't populate various tables on the stack but make them static const.
> Makes the object code smaller by nearly 200 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>  113468	  11200	      0	 124668	  1e6fc	bnx2x_ethtool.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>  113129	  11344	      0	 124473	  1e639	bnx2x_ethtool.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thanks Colin.
Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>

[toc] | [prev] | [next] | [standalone]


#1686766 — Re: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static

FromDavid Miller <davem@davemloft.net>
Date2017-07-13 18:30 +0200
SubjectRe: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
Message-ID<u2Pa2-7UJ-15@gated-at.bofh.it>
In reply to#1684961
From: Colin King <colin.king@canonical.com>
Date: Tue, 11 Jul 2017 11:52:23 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate various tables on the stack but make them static const.
> Makes the object code smaller by nearly 200 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>  113468	  11200	      0	 124668	  1e6fc	bnx2x_ethtool.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>  113129	  11344	      0	 124473	  1e639	bnx2x_ethtool.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web