[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 9 Sep 2011 13:38:53 -0700
From: Greg KH <greg@...ah.com>
To: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: gregkh@...e.de, linux-kernel@...r.kernel.org,
devel@...uxdriverproject.org, virtualization@...ts.osdl.org,
Haiyang Zhang <haiyangz@...rosoft.com>
Subject: Re: [PATCH 05/25] Staging: hv: vmbus: Change the signature of struct
hv_driver probe function
On Thu, Sep 08, 2011 at 07:24:16AM -0700, K. Y. Srinivasan wrote:
> --- a/drivers/staging/hv/vmbus_drv.c
> +++ b/drivers/staging/hv/vmbus_drv.c
> @@ -299,9 +299,15 @@ static int vmbus_probe(struct device *child_device)
> struct hv_driver *drv =
> drv_to_hv_drv(child_device->driver);
> struct hv_device *dev = device_to_hv_device(child_device);
> + const struct hv_vmbus_device_id *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;
Don't duplicate this section of code twice (at least) in the driver.
Make it a "vmbus_match_device()" function that returns the proper
hv_vmbus_device_id * to do something with.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists