]> git.baikalelectronics.ru Git - kernel.git/commit
hv_netvsc: Simplify the limit check in netvsc_set_channels()
authorHaiyang Zhang <haiyangz@microsoft.com>
Fri, 1 Sep 2017 21:30:06 +0000 (14:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Sep 2017 03:39:12 +0000 (20:39 -0700)
commite340481df245fd076b875c28e9a22ade9a525879
treea4e33abdbe35cbb5028968e615c130b247280d01
parentbcf6ff21a9a121fa39b5f3a558122947392e4276
hv_netvsc: Simplify the limit check in netvsc_set_channels()

Because of the following code, net->num_tx_queues equals to
VRSS_CHANNEL_MAX, and max_chn is less than or equals to VRSS_CHANNEL_MAX.

netvsc_drv.c:
alloc_etherdev_mq(sizeof(struct net_device_context),
                                VRSS_CHANNEL_MAX);
rndis_filter.c:
net_device->max_chn = min_t(u32, VRSS_CHANNEL_MAX, num_possible_rss_qs);

So this patch removes the unnecessary limit check before comparing
with "max_chn".

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc_drv.c