Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725360 > unrolled thread

[PATCH net-next, 2/4] hv_netvsc: Simplify num_chn checking in rndis_filter_device_add()

Started byHaiyang Zhang <haiyangz@exchange.microsoft.com>
First post2017-09-01 23:40 +0200
Last post2017-09-01 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH net-next, 2/4] hv_netvsc: Simplify num_chn checking in rndis_filter_device_add() Haiyang Zhang <haiyangz@exchange.microsoft.com> - 2017-09-01 23:40 +0200

#1725360 — [PATCH net-next, 2/4] hv_netvsc: Simplify num_chn checking in rndis_filter_device_add()

FromHaiyang Zhang <haiyangz@exchange.microsoft.com>
Date2017-09-01 23:40 +0200
Subject[PATCH net-next, 2/4] hv_netvsc: Simplify num_chn checking in rndis_filter_device_add()
Message-ID<ul1Ps-2fo-27@gated-at.bofh.it>
From: Haiyang Zhang <haiyangz@microsoft.com>

The minus one and assignment to a local variable is not necessary.
This patch simplifies it.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
 drivers/net/hyperv/rndis_filter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 496fefa7c7c4..69c40b8fccc3 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1067,7 +1067,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
 	struct ndis_recv_scale_cap rsscap;
 	u32 rsscap_size = sizeof(struct ndis_recv_scale_cap);
 	unsigned int gso_max_size = GSO_MAX_SIZE;
-	u32 mtu, size, num_rss_qs;
+	u32 mtu, size;
 	const struct cpumask *node_cpu_mask;
 	u32 num_possible_rss_qs;
 	int i, ret;
@@ -1215,8 +1215,8 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
 							net_device->num_chn);
 
 	atomic_set(&net_device->open_chn, 1);
-	num_rss_qs = net_device->num_chn - 1;
-	if (num_rss_qs == 0)
+
+	if (net_device->num_chn == 1)
 		return net_device;
 
 	for (i = 1; i < net_device->num_chn; i++) {
-- 
2.14.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web