mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: linux-usb@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/8] USB: gadget: f_fs: use usb_string_ids_n()
Date: Thu, 20 May 2010 21:01:51 +0400	[thread overview]
Message-ID: <4BF56AFF.1010406@ru.mvista.com> (raw)
In-Reply-To: <a2865e8e9c3a9a305833ffea9caaec661082d5cf.1274187425.git.m.nazarewicz@samsung.com>

Hello.

Michal Nazarewicz wrote:

> Use usb_string_ids_n() function to simplify string ids
> registeration.
> 
> Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.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

  parent reply	other threads:[~2010-05-20 17:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19  9:04 [PATCH 0/8] Several improvements to USB gadgets Michal Nazarewicz
2010-05-19  9:04 ` [PATCH 1/8] USB: gadget: g_mass_storage: static data instead of dynamic allocation Michal Nazarewicz
2010-05-19  9:04   ` [PATCH 2/8] USB: gadget: f_mass_storage: fsg_add() renamed to fsg_bind_config() Michal Nazarewicz
2010-05-19  9:04     ` [PATCH 3/8] USB: gadget: f_fs: functionfs_add() renamed to functionfs_bind_config() Michal Nazarewicz
2010-05-19  9:04       ` [PATCH 4/8] USB: gadget: composite: usb_string_ids_*() functions added Michal Nazarewicz
2010-05-19  9:04         ` [PATCH 5/8] USB: gadget: f_fs: use usb_string_ids_n() Michal Nazarewicz
2010-05-19  9:04           ` [PATCH 6/8] USB: gadget: g_multi: code clean up and refactoring Michal Nazarewicz
2010-05-19  9:04             ` [PATCH 7/8] USB: gadget: g_multi: more configurable Michal Nazarewicz
2010-05-19  9:04               ` [PATCH 8/8] USB: gadget: g_multi: added documentation and INF files Michal Nazarewicz
2010-05-20 16:22               ` [PATCH 7/8] USB: gadget: g_multi: more configurable David Brownell
2010-05-21 10:13                 ` Michał Nazarewicz
2010-05-20 16:30               ` David Brownell
2010-05-20 17:01           ` Sergei Shtylyov [this message]
2010-05-21  9:42             ` [PATCH 5/8] USB: gadget: f_fs: use usb_string_ids_n() Michał Nazarewicz
2010-05-19  9:19 ` [PATCH 0/8] Several improvements to USB gadgets Michał Nazarewicz
2010-05-19 16:33   ` Greg KH
2010-05-20  8:57 ` Michał Nazarewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BF56AFF.1010406@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.nazarewicz@samsung.com \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome