提交 faa7c00b 编写于 作者: R Rikard Falkeborn 提交者: Yang Yingliang

net: hns3: Constify static structs

mainline inclusion
from mainline-v5.10-rc1
commit e4b91468
category: feature
bugzilla: NA
CVE: NA

----------------------------

A number of static variables were not modified. Make them const to allow
the compiler to put them in read-only memory. In order to do so,
constify a couple of input pointers as well as some local pointers.
This moves about 35Kb to read-only memory as seen by the output of the
size command.

Before:
   text    data     bss     dec     hex filename
 404938  111534     640  517112   7e3f8 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge.ko

After:
   text    data     bss     dec     hex filename
 439499   76974     640  517113   7e3f9 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge.ko
Signed-off-by: NRikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
Reviewed-by: NJunxin Chen <chenjunxin1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e284db77
...@@ -113,7 +113,7 @@ struct hclge_dbg_func { ...@@ -113,7 +113,7 @@ struct hclge_dbg_func {
char *buf, int len); char *buf, int len);
}; };
static struct hclge_dbg_dfx_message hclge_dbg_bios_common_reg[] = { static const struct hclge_dbg_dfx_message hclge_dbg_bios_common_reg[] = {
{false, "Reserved"}, {false, "Reserved"},
{true, "BP_CPU_STATE"}, {true, "BP_CPU_STATE"},
{true, "DFX_MSIX_INFO_NIC_0"}, {true, "DFX_MSIX_INFO_NIC_0"},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册