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:	Thu, 20 May 2010 21:01:51 +0400
From:	Sergei Shtylyov <sshtylyov@...sta.com>
To:	Michal Nazarewicz <m.nazarewicz@...sung.com>
CC:	linux-usb@...r.kernel.org,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/8] USB: gadget: f_fs: use usb_string_ids_n()

Hello.

Michal Nazarewicz wrote:

> Use usb_string_ids_n() function to simplify string ids
> registeration.
> 
> Signed-off-by: Michal Nazarewicz <m.nazarewicz@...sung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
[...]
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index 3fe120f..ffc0001 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
[...]
> @@ -1393,25 +1396,17 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
>  	ffs->ep0req->complete = ffs_ep0_complete;
>  	ffs->ep0req->context = ffs;
>  
> -	/* Get strings identifiers */
> -	for (count = ffs->strings_count, i = 0; i < count; ++i) {
> -		struct usb_gadget_strings **lang;
> -
> -		int id = usb_string_id(cdev);
> -		if (unlikely(id < 0)) {
> -			usb_ep_free_request(cdev->gadget->ep0, ffs->ep0req);
> -			ffs->ep0req = NULL;
> -			return id;
> +	lang = ffs->stringtabs;
> +	while (*lang) {
> +		struct usb_string *str = (*lang)->strings;
> +		int id = first_id;
> +		for (; str->s; ++id, ++str) {
> +			str->id = id;
>  		}

    {} not needed here.

WBR, Sergei
--
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