All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	samuel@sortiz.org
Subject: [PATCH] IRDA: cnt is off by 1
Date: Wed, 11 Feb 2009 22:22:21 +0100	[thread overview]
Message-ID: <4993418D.5020700@gmail.com> (raw)
In-Reply-To: <20090211202755.GA2550@ami.dom.local>

Jarek Poplawski wrote:

> Roel, please resend once more, but separated: something could go to
> stable, but not necessarily together. 

Ok, Here's for irda:

------------------------------>8----------------8<------------------------------
If no prior break occurs, cnt reaches 101 after the loop, so we are still able
to change speed when cnt has become 100.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index 7eafdca..85e88da 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -585,7 +585,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
 		mcs_get_reg(mcs, MCS_RESV_REG, &rval);
 	} while(cnt++ < 100 && (rval & MCS_IRINTX));
 
-	if(cnt >= 100) {
+	if (cnt > 100) {
 		IRDA_ERROR("unable to change speed\n");
 		ret = -EIO;
 		goto error;

  parent reply	other threads:[~2009-02-11 21:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11 10:01 [PATCH] net: off by one, try #2 Roel Kluin
2009-02-11 13:33 ` Jarek Poplawski
2009-02-11 14:22   ` Roel Kluin
2009-02-11 17:14     ` Jarek Poplawski
2009-02-11 19:33       ` Roel Kluin
2009-02-11 20:27         ` Jarek Poplawski
2009-02-11 20:58           ` Jarek Poplawski
2009-02-11 22:55             ` [PATCH] 3c505: do not set pcb->data.raw beyond its size Roel Kluin
2009-02-12  6:37               ` Jarek Poplawski
2009-02-13  0:52                 ` David Miller
2009-02-11 21:22           ` Roel Kluin [this message]
2009-02-13  0:42             ` [PATCH] IRDA: cnt is off by 1 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=4993418D.5020700@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=samuel@sortiz.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.