Skip to contentSkip to conversation

staging: hv: Remove unnecessary ASSERTs in netvsc_initialize()

PATCH New Haiyang Zhang 1 participant 3 messages Feb 18, 2011

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 2/2 staging: hv: Fix the WARN_ON condition in free_net_device()

In reply to Haiyang Zhang

In a previous commit, 7a09876d, ASSERT was changed to WARN_ON, but the condition wasn't updated. This patch fixed this error.

---
 drivers/staging/hv/netvsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/hv/netvsc.c +1 -1
index f21a59d..20b1597 100644
@@ -95,7 +95,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
 
 static void free_net_device(struct netvsc_device *device)
 {
-	WARN_ON(atomic_read(&device->refcnt) == 0);
+	WARN_ON(atomic_read(&device->refcnt) != 0);
 	device->dev->ext = NULL;
 	kfree(device);
 }
Signature · 1 line
1.6.3.2
#0 lore raw

PATCH 1/2 staging: hv: Remove unnecessary ASSERTs in netvsc_initialize()

These fields have been assigned in netvsc_drv_init() before calling netvsc_initialize(), so there is no need to check them. The ASSERTs were already commented out, and this patch removes them.

---
 drivers/staging/hv/netvsc.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/staging/hv/netvsc.c +0 -5
index 8c6d4ae..f21a59d 100644
@@ -188,11 +188,6 @@ int netvsc_initialize(struct hv_driver *drv)
 	drv->name = driver_name;
 	memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));
 
-	/* Make sure it is set by the caller */
-	/* FIXME: These probably should still be tested in some way */
-	/* ASSERT(driver->OnReceiveCallback); */
-	/* ASSERT(driver->OnLinkStatusChanged); */
-
 	/* Setup the dispatch table */
 	driver->base.dev_add	= netvsc_device_add;
 	driver->base.dev_rm	= netvsc_device_remove;
Signature · 1 line
1.6.3.2
#2 lore raw

PATCH 2/2 staging: hv: Fix the WARN_ON condition in free_net_device()

In a previous commit, 7a09876d, ASSERT was changed to WARN_ON, but the condition wasn't updated. This patch fixed this error.

---
 drivers/staging/hv/netvsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/hv/netvsc.c +1 -1
index f21a59d..20b1597 100644
@@ -95,7 +95,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
 
 static void free_net_device(struct netvsc_device *device)
 {
-	WARN_ON(atomic_read(&device->refcnt) == 0);
+	WARN_ON(atomic_read(&device->refcnt) != 0);
 	device->dev->ext = NULL;
 	kfree(device);
 }
Signature · 1 line
1.6.3.2