diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-06-14 14:20:50 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-06-29 14:03:47 +0200 |
commit | bce933b85a34514fe34fa559be1d8ccd1f39f954 (patch) | |
tree | fb6a5d284cab47e1ccfad652a0d4fbaa8176beed /hw | |
parent | 807464d8a7326e1025a2f392bf41636b0809d6da (diff) | |
download | qemu-bce933b85a34514fe34fa559be1d8ccd1f39f954.tar.gz qemu-bce933b85a34514fe34fa559be1d8ccd1f39f954.tar.bz2 qemu-bce933b85a34514fe34fa559be1d8ccd1f39f954.zip |
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 <bcketchum@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/char/serial.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c index e65e9e0b4c..904b218c21 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. */ |