Skip to content

Commit f4ee147

Browse files
Colin Ian Kingdavem330
authored andcommitted
be2net: make two arrays static const, makes object smaller
Don't populate the arrays on the stack but instead make them static const. Makes the object code smaller by 281 bytes. Before: text data bss dec hex filename 87553 5672 0 93225 16c29 benet/be_cmds.o After: text data bss dec hex filename 87112 5832 0 92944 16b10 benet/be_cmds.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 52d5654 commit f4ee147

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/emulex/benet/be_cmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,7 +2756,7 @@ static int be_flash_BEx(struct be_adapter *adapter,
27562756
bool crc_match;
27572757
const u8 *p;
27582758

2759-
struct flash_comp gen3_flash_types[] = {
2759+
static const struct flash_comp gen3_flash_types[] = {
27602760
{ BE3_ISCSI_PRIMARY_IMAGE_START, OPTYPE_ISCSI_ACTIVE,
27612761
BE3_COMP_MAX_SIZE, IMAGE_FIRMWARE_ISCSI},
27622762
{ BE3_REDBOOT_START, OPTYPE_REDBOOT,
@@ -2779,7 +2779,7 @@ static int be_flash_BEx(struct be_adapter *adapter,
27792779
BE3_PHY_FW_COMP_MAX_SIZE, IMAGE_FIRMWARE_PHY}
27802780
};
27812781

2782-
struct flash_comp gen2_flash_types[] = {
2782+
static const struct flash_comp gen2_flash_types[] = {
27832783
{ BE2_ISCSI_PRIMARY_IMAGE_START, OPTYPE_ISCSI_ACTIVE,
27842784
BE2_COMP_MAX_SIZE, IMAGE_FIRMWARE_ISCSI},
27852785
{ BE2_REDBOOT_START, OPTYPE_REDBOOT,

0 commit comments

Comments
 (0)