Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hv_netvsc: Remove unnecessary var link_state from struct netvsc_device_info

We simply use rndis_device->link_state in the netdev_dbg. The variable,
link_state from struct netvsc_device_info, is not used anywhere else.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Haiyang Zhang and committed by
David S. Miller
dedb459e 00a3855d

+4 -5
+3 -2
drivers/net/hyperv/hyperv_net.h
··· 146 146 147 147 struct netvsc_device_info { 148 148 unsigned char mac_adr[ETH_ALEN]; 149 - bool link_state; /* 0 - link up, 1 - link down */ 150 149 int ring_size; 151 150 u32 max_num_vrss_chns; 152 151 u32 num_chn; ··· 164 165 struct net_device *ndev; 165 166 166 167 enum rndis_device_state state; 167 - bool link_state; 168 + 168 169 atomic_t new_req_id; 169 170 170 171 spinlock_t request_lock; 171 172 struct list_head req_list; 172 173 173 174 struct work_struct mcast_work; 175 + 176 + bool link_state; /* 0 - link up, 1 - link down */ 174 177 175 178 u8 hw_mac_adr[ETH_ALEN]; 176 179 u8 rss_key[NETVSC_HASH_KEYLEN];
+1 -3
drivers/net/hyperv/rndis_filter.c
··· 1185 1185 1186 1186 rndis_filter_query_device_link_status(rndis_device); 1187 1187 1188 - device_info->link_state = rndis_device->link_state; 1189 - 1190 1188 netdev_dbg(net, "Device MAC %pM link state %s\n", 1191 1189 rndis_device->hw_mac_adr, 1192 - device_info->link_state ? "down" : "up"); 1190 + rndis_device->link_state ? "down" : "up"); 1193 1191 1194 1192 if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) 1195 1193 return 0;