netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@fifo99.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: netdev@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: variables reach -1, but 0 tested
Date: Sat, 31 Jan 2009 12:35:12 -0800	[thread overview]
Message-ID: <1233434112.5903.28.camel@desktop> (raw)
In-Reply-To: <498429AE.1080404@gmail.com>

On Sat, 2009-01-31 at 11:36 +0100, Roel Kluin wrote:

>  
> -	while (limit--) {
> +	while (--limit) {
>  		val = phy_read(phy, MII_BMCR);
>  		if (val >= 0 && (val & BMCR_RESET) == 0)
>  			break;

It looks like these are checked for <= to 0 , are these changes strictly
nessesary?

>  
>  	/* make sure EEPROM has finished loading before setting GPIO_CFG */
>  	timeout=1000;
> -	while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
> +	while ( --timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
>  		udelay(10);

If your doing "timeOut" to "timeout" below may as well drop the space
above after the "(" ..


Daniel


  reply	other threads:[~2009-01-31 20:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-31 10:36 [PATCH] net: variables reach -1, but 0 tested Roel Kluin
2009-01-31 20:35 ` Daniel Walker [this message]
2009-02-01  9:58   ` David Miller
2009-02-01 16:23   ` Roel Kluin
2009-02-03  7:18     ` David Miller

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=1233434112.5903.28.camel@desktop \
    --to=dwalker@fifo99.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roel.kluin@gmail.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;
as well as URLs for NNTP newsgroup(s).