mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
video/uvc: use memweight()
Use memweight() to count the total number of bits set in memory area. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
0121ad62c2
commit
9a601396e8
1 changed files with 2 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue