Thread (39 messages) 39 messages, 3 authors, 2011-09-10

Re: [PATCH 07/25] Staging: hv: vmbus: Change the signature of struct hv_driver remove() function

From: Greg KH <hidden>
Date: 2011-09-09 20:47:27
Also in: lkml

On Thu, Sep 08, 2011 at 07:24:18AM -0700, K. Y. Srinivasan wrote:
In preparation for leveraging the driver_data in  struct
hv_vmbus_device_id, change the signature of struct hv_driver remove() function.
Why?  This shouldn't be needed at remove() time as the driver already
has saved off the needed id information in its probe function, if it
needed it.
quoted hunk ↗ jump to hunk
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -329,12 +329,19 @@ static int vmbus_remove(struct device *child_device)
 	struct hv_driver *drv;
 
 	struct hv_device *dev = device_to_hv_device(child_device);
+	const struct hv_vmbus_device_id *dev_id;
 
 	if (child_device->driver) {
 		drv = drv_to_hv_drv(child_device->driver);
+		dev_id = drv->id_table;
+
+		for (; !is_null_guid(dev_id->guid); dev_id++)
+			if (!memcmp(&dev_id->guid, &dev->dev_type.b,
+					sizeof(uuid_le)))
+				break;
Even though it is wrong, look you duplicated the matching logic again!

ick.

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help