Re: [PATCH 06/10] video/uvc: use memweight()
Hi Akinobu, On Monday 21 May 2012 21:03:10 Akinobu Mita wrote: > 2012/5/21 Laurent Pinchart : > > Hi Akinobu, > > > > Thank you for the patch. > > > > On Sunday 20 May 2012 22:23:19 Akinobu Mita wrote: > >> Use memweight() to count the total number of bits set in memory area. > >> > >> Signed-off-by: Akinobu Mita > >> Cc: Laurent Pinchart > >> Cc: linux-media@vger.kernel.org > > > > Laurent Pinchart > > You meant Acked-by, didn't you? Oops, yes, sorry. Bad copy & paste. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 06/10] video/uvc: use memweight()
2012/5/21 Laurent Pinchart : > Hi Akinobu, > > Thank you for the patch. > > On Sunday 20 May 2012 22:23:19 Akinobu Mita wrote: >> Use memweight() to count the total number of bits set in memory area. >> >> Signed-off-by: Akinobu Mita >> Cc: Laurent Pinchart >> Cc: linux-media@vger.kernel.org > > Laurent Pinchart You meant Acked-by, didn't you? -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 06/10] video/uvc: use memweight()
Hi Akinobu, Thank you for the patch. On Sunday 20 May 2012 22:23:19 Akinobu Mita wrote: > Use memweight() to count the total number of bits set in memory area. > > Signed-off-by: Akinobu Mita > Cc: Laurent Pinchart > Cc: linux-media@vger.kernel.org Laurent Pinchart > --- > drivers/media/video/uvc/uvc_ctrl.c |5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/video/uvc/uvc_ctrl.c > b/drivers/media/video/uvc/uvc_ctrl.c index 0efd3b1..8683be0 100644 > --- a/drivers/media/video/uvc/uvc_ctrl.c > +++ b/drivers/media/video/uvc/uvc_ctrl.c > @@ -1851,7 +1851,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev) > /* Walk the entities list and instantiate controls */ > list_for_each_entry(entity, &dev->entities, list) { > struct uvc_control *ctrl; > - unsigned int bControlSize = 0, ncontrols = 0; > + unsigned int bControlSize = 0, ncontrols; > __u8 *bmControls = NULL; > > if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) { > @@ -1869,8 +1869,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev) > uvc_ctrl_prune_entity(dev, entity); > > /* Count supported controls and allocate the controls array */ > - for (i = 0; i < bControlSize; ++i) > - ncontrols += hweight8(bmControls[i]); > + ncontrols = memweight(bmControls, bControlSize); > if (ncontrols == 0) > continue; -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 06/10] video/uvc: use memweight()
Use memweight() to count the total number of bits set in memory area. Signed-off-by: Akinobu Mita Cc: Laurent Pinchart Cc: linux-media@vger.kernel.org --- drivers/media/video/uvc/uvc_ctrl.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index 0efd3b1..8683be0 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c @@ -1851,7 +1851,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev) /* Walk the entities list and instantiate controls */ list_for_each_entry(entity, &dev->entities, list) { struct uvc_control *ctrl; - unsigned int bControlSize = 0, ncontrols = 0; + unsigned int bControlSize = 0, ncontrols; __u8 *bmControls = NULL; if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) { @@ -1869,8 +1869,7 @@ int uvc_ctrl_init_device(struct uvc_device *dev) uvc_ctrl_prune_entity(dev, entity); /* Count supported controls and allocate the controls array */ - for (i = 0; i < bControlSize; ++i) - ncontrols += hweight8(bmControls[i]); + ncontrols = memweight(bmControls, bControlSize); if (ncontrols == 0) continue; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html