aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2013-06-03 15:14:48 +1000
committerMichael Tokarev <mjt@tls.msk.ru>2013-06-11 23:45:44 +0400
commitb5601df7624b461759651c49ac72a189951780b9 (patch)
treef0cf9557619d509217923c2edfb127fa244e153c /hw/char
parent8e8638fa87ff045f5dadec7342301bf10de776ff (diff)
char/serial: serial_ioport_write: Factor out common code
These three lines are common to both FIFO and regular mode. Just factor them out to outside the if rather than replicate the same lines inside both if and else. Cc: qemu-trivial@nongnu.org Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/serial.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 0a2b6c9acc..017610eb45 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -285,15 +285,11 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val,
fifo8_pop(&s->xmit_fifo);
}
fifo8_push(&s->xmit_fifo, s->thr);
- s->thr_ipending = 0;
s->lsr &= ~UART_LSR_TEMT;
- s->lsr &= ~UART_LSR_THRE;
- serial_update_irq(s);
- } else {
- s->thr_ipending = 0;
- s->lsr &= ~UART_LSR_THRE;
- serial_update_irq(s);
}
+ s->thr_ipending = 0;
+ s->lsr &= ~UART_LSR_THRE;
+ serial_update_irq(s);
serial_xmit(NULL, G_IO_OUT, s);
}
break;