* [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
@ 2017-07-11 10:52 ` Colin King
0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2017-07-11 10:52 UTC (permalink / raw)
To: Yuval Mintz, Ariel Elior, everest-linux-l2, netdev
Cc: kernel-janitors, linux-kernel
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
@ 2017-07-11 10:52 ` Colin King
0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2017-07-11 10:52 UTC (permalink / raw)
To: Yuval Mintz, Ariel Elior, everest-linux-l2, netdev
Cc: kernel-janitors, linux-kernel
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
2017-07-11 10:52 ` Colin King
@ 2017-07-12 13:42 ` Mintz, Yuval
-1 siblings, 0 replies; 6+ messages in thread
From: Mintz, Yuval @ 2017-07-12 13:42 UTC (permalink / raw)
To: Colin King, netdev; +Cc: kernel-janitors, linux-kernel, Elior, Ariel
> 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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
@ 2017-07-12 13:42 ` Mintz, Yuval
0 siblings, 0 replies; 6+ messages in thread
From: Mintz, Yuval @ 2017-07-12 13:42 UTC (permalink / raw)
To: Colin King, netdev; +Cc: kernel-janitors, linux-kernel, Elior, Ariel
PiBEb24ndCBwb3B1bGF0ZSB2YXJpb3VzIHRhYmxlcyBvbiB0aGUgc3RhY2sgYnV0IG1ha2UgdGhl
bSBzdGF0aWMgY29uc3QuDQo+IE1ha2VzIHRoZSBvYmplY3QgY29kZSBzbWFsbGVyIGJ5IG5lYXJs
eSAyMDAgYnl0ZXM6DQo+IA0KPiBCZWZvcmU6DQo+ICAgIHRleHQJICAgZGF0YQkgICAgYnNzCSAg
ICBkZWMJICAgIGhleAlmaWxlbmFtZQ0KPiAgMTEzNDY4CSAgMTEyMDAJICAgICAgMAkgMTI0NjY4
CSAgMWU2ZmMJYm54MnhfZXRodG9vbC5vDQo+IA0KPiBBZnRlcjoNCj4gICAgdGV4dAkgICBkYXRh
CSAgICBic3MJICAgIGRlYwkgICAgaGV4CWZpbGVuYW1lDQo+ICAxMTMxMjkJICAxMTM0NAkgICAg
ICAwCSAxMjQ0NzMJICAxZTYzOQlibngyeF9ldGh0b29sLm8NCj4gDQo+IFNpZ25lZC1vZmYtYnk6
IENvbGluIElhbiBLaW5nIDxjb2xpbi5raW5nQGNhbm9uaWNhbC5jb20+DQoNClRoYW5rcyBDb2xp
bi4NCkFja2VkLWJ5OiBZdXZhbCBNaW50eiA8WXV2YWwuTWludHpAY2F2aXVtLmNvbT4NCg=
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
2017-07-11 10:52 ` Colin King
@ 2017-07-13 16:24 ` David Miller
-1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-07-13 16:24 UTC (permalink / raw)
To: colin.king
Cc: Yuval.Mintz, ariel.elior, everest-linux-l2, netdev,
kernel-janitors, linux-kernel
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net: broadcom: bnx2x: make a couple of const arrays static
@ 2017-07-13 16:24 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-07-13 16:24 UTC (permalink / raw)
To: colin.king
Cc: Yuval.Mintz, ariel.elior, everest-linux-l2, netdev,
kernel-janitors, linux-kernel
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-07-13 16:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11 10:52 [PATCH] net: broadcom: bnx2x: make a couple of const arrays static Colin King
2017-07-11 10:52 ` Colin King
2017-07-12 13:42 ` Mintz, Yuval
2017-07-12 13:42 ` Mintz, Yuval
2017-07-13 16:24 ` David Miller
2017-07-13 16:24 ` David Miller
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.