lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 18 Jun 2012 20:06:29 -0300
From:	Mauro Carvalho Chehab <mchehab@...hat.com>
To:	Akinobu Mita <akinobu.mita@...il.com>
CC:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	linux-media@...r.kernel.org
Subject: Re: [PATCH v3 5/9] video/uvc: use memweight()

Em 08-06-2012 21:50, Akinobu Mita escreveu:
> Use memweight() to count the total number of bits set in memory area.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
> Acked-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Cc: linux-media@...r.kernel.org

Acked-by: Mauro Carvalho Chehab <mchehab@...hat.com>

> ---
> No changes from v1
> 
>   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 af26bbe..f7061a5 100644
> --- a/drivers/media/video/uvc/uvc_ctrl.c
> +++ b/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;
>   
> 


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ