From: "Michał Nazarewicz" <m.nazarewicz@samsung.com>
To: Andy Isaacson <adi@hexapodia.org>,
Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
LKML <linux-kernel@vger.kernel.org>,
linux-usb <linux-usb@vger.kernel.org>,
"Wang, Qi" <qi.wang@intel.com>,
"Wang, Yong Y" <yong.y.wang@intel.com>,
Andrew <andrew.chih.howe.khor@intel.com>,
Intel OTC <joel.clark@intel.com>,
"Foster, Margie" <margie.foster@intel.com>,
"Ewe, Kok Howg" <kok.howg.ewe@intel.com>
Subject: Re: [PATCH v7] USB device driver of Topcliff PCH
Date: Wed, 10 Nov 2010 13:29:58 +0100 [thread overview]
Message-ID: <op.vlyfn8qo7p4s8u@pikus> (raw)
In-Reply-To: <001601cb7fca$918dc5e0$66f8800a@maildom.okisemi.com>
On Tue, 09 Nov 2010 05:57:05 +0100, Toshiharu Okada <toshiharu-linux@dsn.okisemi.com> wrote:
> I will modify to "if-else-if-else" as follows.
> if (!list_empty(&ep->queue)) {
> dev_dbg(&dev->pdev->dev, "%s: list not empty", __func__);
> ret = -EAGAIN;
> } else {
> if (halt) { /* halt or clear halt */
> if (ep->num == PCH_UDC_EP0)
> ep->dev->stall = 1;
> pch_udc_ep_set_stall(ep);
> pch_udc_enable_ep_interrupts(ep->dev, PCH_UDC_EPINT(ep->in,
> ep->num));
> ret = 0;
> } else {
> pch_udc_ep_clear_stall(ep);
> ret = 0;
> }
> }
In that case, make it:
if (list_empty(&ep->queue)) {
if (halt) { /* halt or clear halt */
if (ep->num == PCH_UDC_EP0)
ep->dev->stall = 1;
pch_udc_ep_set_stall(ep);
pch_udc_enable_ep_interrupts(ep->dev, PCH_UDC_EPINT(ep->in, ep->num));
} else {
pch_udc_ep_clear_stall(ep);
}
ret = 0;
} else {
dev_dbg(&dev->pdev->dev, "%s: list not empty", __func__);
ret = -EAGAIN;
}
Ie. no need to put "ret = 0;" twice in the code.
--
Best regards, _ _
| Humble Liege of Serenely Enlightened Majesty of o' \,=./ `o
| Computer Science, Michał "mina86" Nazarewicz (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
next prev parent reply other threads:[~2010-11-10 12:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-25 10:24 [PATCH v7] USB device driver of Topcliff PCH Toshiharu Okada
2010-11-03 18:37 ` Andy Isaacson
2010-11-04 8:35 ` Toshiharu Okada
2010-11-08 11:22 ` Michał Nazarewicz
2010-11-09 4:57 ` Toshiharu Okada
2010-11-10 12:29 ` Michał Nazarewicz [this message]
2010-11-11 1:06 ` Toshiharu Okada
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=op.vlyfn8qo7p4s8u@pikus \
--to=m.nazarewicz@samsung.com \
--cc=adi@hexapodia.org \
--cc=andrew.chih.howe.khor@intel.com \
--cc=gregkh@suse.de \
--cc=joel.clark@intel.com \
--cc=kok.howg.ewe@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=margie.foster@intel.com \
--cc=qi.wang@intel.com \
--cc=toshiharu-linux@dsn.okisemi.com \
--cc=yong.y.wang@intel.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