From 112917c5b5d94f74ff340a52cab478a92d257476 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 20 Feb 2020 16:54:46 +0800 Subject: [PATCH] net: hns3: make array spec_opcode static const, makes object smaller driver inclusion category: bugfix bugzilla: NA CVE: NA 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 Signed-off-by: David S. Miller Signed-off-by: Guangbin Huang Reviewed-by: Peng Li Reviewed-by: Zhong Zhaohui Signed-off-by: Yang Yingliang --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c index fc3a6a900cca..286d2291e524 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c @@ -75,7 +75,7 @@ static bool hclgevf_cmd_csq_done(struct hclgevf_hw *hw) static bool hclgevf_is_special_opcode(u16 opcode) { - u16 spec_opcode[] = {0x30, 0x31, 0x32}; + static const u16 spec_opcode[] = {0x30, 0x31, 0x32}; int i; for (i = 0; i < ARRAY_SIZE(spec_opcode); i++) { -- GitLab