From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDA48-00011J-8D for qemu-devel@nongnu.org; Tue, 11 Feb 2014 04:55:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDA43-0005wM-48 for qemu-devel@nongnu.org; Tue, 11 Feb 2014 04:55:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDA42-0005wC-RQ for qemu-devel@nongnu.org; Tue, 11 Feb 2014 04:55:39 -0500 Date: Tue, 11 Feb 2014 09:55:29 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20140211095528.GA2509@work-vm> References: <153a8e98437c7d4b7fc3df2bf375fbc9e0bdb8ef.1392101145.git.peter.crosthwaite@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153a8e98437c7d4b7fc3df2bf375fbc9e0bdb8ef.1392101145.git.peter.crosthwaite@xilinx.com> Subject: Re: [Qemu-devel] [PATCH bugfix v1 1/1] char/serial: Fix emptyness check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: mkletzan@redhat.com, peter.maydell@linaro.org, edgari@xilinx.com, mjt@tls.msk.ru, qemu-devel@nongnu.org * Peter Crosthwaite (peter.crosthwaite@xilinx.com) wrote: > This was guarding against a full fifo rather than an empty fifo when > popping. Fix. > > Signed-off-by: Peter Crosthwaite > --- Reviewed-by: Dr. David Alan Gilbert I think this brings it back to how it was on the old FIFO code. > > hw/char/serial.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/char/serial.c b/hw/char/serial.c > index 27dab7d..6d3b5af 100644 > --- a/hw/char/serial.c > +++ b/hw/char/serial.c > @@ -225,7 +225,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque) > > if (s->tsr_retry <= 0) { > if (s->fcr & UART_FCR_FE) { > - s->tsr = fifo8_is_full(&s->xmit_fifo) ? > + s->tsr = fifo8_is_empty(&s->xmit_fifo) ? > 0 : fifo8_pop(&s->xmit_fifo); > if (!s->xmit_fifo.num) { > s->lsr |= UART_LSR_THRE; > -- > 1.8.5.4 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK