Skip to content

Commit

Permalink
serial: simplify tsr_retry reset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini committed Jun 29, 2016
1 parent 807464d commit bce933b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hw/char/serial.c
Expand Up @@ -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. */
Expand Down

0 comments on commit bce933b

Please sign in to comment.