lkml.org 
[lkml]   [2015]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/9] usb/host/fotg210: Remove useless else statement
From
Date
On Mon, 2015-10-12 at 23:22 +0200, Peter Senna Tschudin wrote:
> This patch remove an else statement after a return to make the code
> easier to understand.
[]
> diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
[]
> @@ -1402,10 +1402,9 @@ static int check_reset_complete(struct fotg210_hcd *fotg210, int index,
> "Failed to enable port %d on root hub TT\n",
> index + 1);
> return port_status;
> - } else {
> - fotg210_dbg(fotg210, "port %d reset complete, port enabled\n",
> - index + 1);
> }
> + fotg210_dbg(fotg210, "port %d reset complete, port enabled\n",
> + index + 1);
>
> return port_status;
> }

Probably better written as:

/* if reset finished and it's still not enabled -- handoff */
if (!(port_status & PORT_PE))
/* with integrated TT, there's nobody to hand it to! */
fotg210_dbg(fotg210, "failed to enable port %d on root hub TT\n",
index + 1);
else
fotg210_dbg(fotg210, "port %d reset complete, port enabled\n",
index + 1);

return port_status;




\
 
 \ /
  Last update: 2015-10-13 00:41    [W:0.292 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site