From 78de3827892cbfc8051d383bdf115df6d3c6c2eb Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Mon, 30 Jul 2012 14:41:02 -0700 Subject: [PATCH] --- yaml --- r: 319928 b: refs/heads/master c: 9a601396e8681d9884a9f429cba7ceb2b2a4d21c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/video/uvc/uvc_ctrl.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 7fc0ce211154..c48956025f91 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0121ad62c20ed779e38ad689071da2805f03249f +refs/heads/master: 9a601396e8681d9884a9f429cba7ceb2b2a4d21c diff --git a/trunk/drivers/media/video/uvc/uvc_ctrl.c b/trunk/drivers/media/video/uvc/uvc_ctrl.c index af26bbe6f76e..f7061a5ef1d2 100644 --- a/trunk/drivers/media/video/uvc/uvc_ctrl.c +++ b/trunk/drivers/media/video/uvc/uvc_ctrl.c @@ -2083,7 +2083,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) { @@ -2101,8 +2101,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;