[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0902092358310.12457@ftp.linux-mips.org>
Date: Tue, 10 Feb 2009 00:03:43 +0000 (GMT)
From: "Maciej W. Rozycki" <macro@...ux-mips.org>
To: Roel Kluin <roel.kluin@...il.com>
cc: lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] serial: Z85C30: BCM1480: loops should end at 0
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@...il.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
--
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