mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] serial: Z85C30: BCM1480: loops should end at 0
Date: Tue, 10 Feb 2009 00:03:43 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0902092358310.12457@ftp.linux-mips.org> (raw)
In-Reply-To: <498EFCF8.5070106@gmail.com>

On Sun, 8 Feb 2009, Roel Kluin wrote:

> With a postfix decrement 'loops' reach -1, not 0, which is subsequently
> returned. In drivers/serial/zs.c, line 1137 it is considered as a boolean with 0
> as failure:
> 
> if (zs_transmit_drain(zport, irq))
>                 write_zsdata(zport, ch);
> 
> so to use it as such loops should end at 0 after the loop rather than -1.
> This also fix similar issues in other functions.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Another solution would be to change the test at drivers/serial/zs.c, line 1137:
> 
> if (zs_transmit_drain(zport, irq) == -1)
> 
> Is that preferred?

 I'm tempted to rewrite these as do {} while loops instead.  Thanks for 
the report -- I'm running out of disk space on my development system 
again, so please allow me a couple of days to make a clean-up before I get 
back to your report.  The change has to be split into two separate 
patches, BTW.

  Maciej

      reply	other threads:[~2009-02-10  0:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-08 15:40 Roel Kluin
2009-02-10  0:03 ` Maciej W. Rozycki [this message]

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=alpine.LFD.1.10.0902092358310.12457@ftp.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=linux-kernel@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

Powered by JetHome