Skip to content

Commit 1b17ca0

Browse files
Colin Ian Kingdavem330
authored andcommitted
hv_netvsc: make const array ver_list static, reduces object code size
Don't populate const array ver_list on the stack, instead make it static. Makes the object code smaller by over 400 bytes: Before: text data bss dec hex filename 18444 3168 320 21932 55ac drivers/net/hyperv/netvsc.o After: text data bss dec hex filename 17950 3224 320 21494 53f6 drivers/net/hyperv/netvsc.o (gcc 6.3.0, x86-64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b5d7388 commit 1b17ca0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/hyperv/netvsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ static int netvsc_connect_vsp(struct hv_device *device,
484484
struct netvsc_device *net_device,
485485
const struct netvsc_device_info *device_info)
486486
{
487-
const u32 ver_list[] = {
487+
static const u32 ver_list[] = {
488488
NVSP_PROTOCOL_VERSION_1, NVSP_PROTOCOL_VERSION_2,
489489
NVSP_PROTOCOL_VERSION_4, NVSP_PROTOCOL_VERSION_5
490490
};

0 commit comments

Comments
 (0)