Skip to content

Commit e9ac25b

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: hns3: make array spec_opcode static const, makes object smaller
Don't populate the array spec_opcode on the stack but instead make it static const. Makes the object code smaller by 48 bytes. Before: text data bss dec hex filename 6914 1040 128 8082 1f92 hns3/hns3vf/hclgevf_cmd.o After: text data bss dec hex filename 6866 1040 128 8034 1f62 hns3/hns3vf/hclgevf_cmd.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 f4ee147 commit e9ac25b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static bool hclgevf_cmd_csq_done(struct hclgevf_hw *hw)
7474

7575
static bool hclgevf_is_special_opcode(u16 opcode)
7676
{
77-
u16 spec_opcode[] = {0x30, 0x31, 0x32};
77+
static const u16 spec_opcode[] = {0x30, 0x31, 0x32};
7878
int i;
7979

8080
for (i = 0; i < ARRAY_SIZE(spec_opcode); i++) {

0 commit comments

Comments
 (0)