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]
Message-ID: <1444687617.9184.4.camel@perches.com>
Date:	Mon, 12 Oct 2015 15:06:57 -0700
From:	Joe Perches <joe@...ches.com>
To:	Peter Senna Tschudin <peter.senna@...il.com>
Cc:	gregkh@...uxfoundation.org, sergei.shtylyov@...entembedded.com,
	jkosina@...e.cz, rdunlap@...radead.org, balbi@...com,
	standby24x7@...il.com, chris@...vick.com,
	stern@...land.harvard.edu, john453@...aday-tech.com,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/9] usb/host/fotg210: Remove useless else statement

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;


--
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