lkml.org 
[lkml]   [2010]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7] USB device driver of Topcliff PCH
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--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-11-10 13:33    [W:0.140 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site