From: Paolo Bonzini Date: Tue, 14 Jun 2016 12:20:50 +0000 (+0200) Subject: serial: simplify tsr_retry reset X-Git-Tag: v2.7.0-rc0~75^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bce933b85a34514fe34fa559be1d8ccd1f39f954;p=thirdparty%2Fqemu.git serial: simplify tsr_retry reset Move common code outside the if, and reset tsr_retry even in loopback mode. Right now it cannot become non-zero, but it will be possible as soon as we start respecting the baud rate. Tested-by: Bret Ketchum Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Paolo Bonzini --- diff --git a/hw/char/serial.c b/hw/char/serial.c index e65e9e0b4c3..904b218c211 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -258,10 +258,8 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque) s->tsr_retry++; return FALSE; } - s->tsr_retry = 0; - } else { - s->tsr_retry = 0; } + s->tsr_retry = 0; /* Transmit another byte if it is already available. It is only possible when FIFO is enabled and not empty. */