Re: [PATCH 020/117] Staging: hv: vmbus: Support the notion of id tables in vmbus_match()

2011-08-23 Thread Greg KH
On Fri, Jul 15, 2011 at 10:46:08AM -0700, K. Y. Srinivasan wrote:
 Introduce code to handle driver specific id tables to the vmbus core
 (vmbus_match). This would allow us to handle more than one device type
 with a given driver.
 
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com
 Signed-off-by: Haiyang Zhang haiya...@microsoft.com
 ---
  drivers/staging/hv/vmbus_drv.c |   21 -
  1 files changed, 16 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
 index 7baba62..3a8eb36 100644
 --- a/drivers/staging/hv/vmbus_drv.c
 +++ b/drivers/staging/hv/vmbus_drv.c
 @@ -255,21 +255,32 @@ static int vmbus_uevent(struct device *device, struct 
 kobj_uevent_env *env)
   return ret;
  }
  
 +static bool is_not_null_guid(const __u8 *guid)

Negative function names cause people's heads to get confused.

Please do is_null_guid() instead.

thanks,

greg k-h
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


RE: [PATCH 020/117] Staging: hv: vmbus: Support the notion of id tables in vmbus_match()

2011-07-16 Thread KY Srinivasan


 -Original Message-
 From: Christoph Hellwig [mailto:h...@infradead.org]
 Sent: Friday, July 15, 2011 10:03 PM
 To: KY Srinivasan
 Cc: gre...@suse.de; linux-ker...@vger.kernel.org;
 de...@linuxdriverproject.org; virtualizat...@lists.osdl.org; Haiyang Zhang
 Subject: Re: [PATCH 020/117] Staging: hv: vmbus: Support the notion of id 
 tables
 in vmbus_match()
 
 On Fri, Jul 15, 2011 at 10:46:08AM -0700, K. Y. Srinivasan wrote:
  +static bool is_not_null_guid(const __u8 *guid)
  +{
  +   int i;
  +
  +   for (i = 0; i  (sizeof(struct hv_vmbus_device_id)); i++)
  +   if (guid[i] != 0)
  +   return true;
  +   return false;
  +}
 
 would be nice to add uuid_{le,be}_is_nil helpers to uuid.h.  I also
 think simply using a memcpy might be more efficient than the hand-rolled
 loop.
Having a helper function would be great. With regards to the efficiency of this 
loop,
this is not a performance critical path. If people feel strongly about this, I 
could 
change this; perhaps as a separate patch on top of this series; I don't want to 
send a large
patch-set like this again.

Regards,

K. Y
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


Re: [PATCH 020/117] Staging: hv: vmbus: Support the notion of id tables in vmbus_match()

2011-07-16 Thread Christoph Hellwig
On Sat, Jul 16, 2011 at 12:54:46PM +, KY Srinivasan wrote:
  would be nice to add uuid_{le,be}_is_nil helpers to uuid.h.  I also
  think simply using a memcpy might be more efficient than the hand-rolled
  loop.
 Having a helper function would be great. With regards to the efficiency of 
 this loop,
 this is not a performance critical path. If people feel strongly about this, 
 I could 
 change this; perhaps as a separate patch on top of this series; I don't want 
 to send a large
 patch-set like this again.

I'm fine with doing it later.

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


Re: [PATCH 020/117] Staging: hv: vmbus: Support the notion of id tables in vmbus_match()

2011-07-15 Thread Christoph Hellwig
On Fri, Jul 15, 2011 at 10:46:08AM -0700, K. Y. Srinivasan wrote:
 +static bool is_not_null_guid(const __u8 *guid)
 +{
 + int i;
 +
 + for (i = 0; i  (sizeof(struct hv_vmbus_device_id)); i++)
 + if (guid[i] != 0)
 + return true;
 + return false;
 +}

would be nice to add uuid_{le,be}_is_nil helpers to uuid.h.  I also
think simply using a memcpy might be more efficient than the hand-rolled
loop.
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization