]> Git Repo - qemu.git/commitdiff
char/serial: serial_ioport_write: Factor out common code
authorPeter Crosthwaite <[email protected]>
Mon, 3 Jun 2013 05:14:48 +0000 (15:14 +1000)
committerMichael Tokarev <[email protected]>
Tue, 11 Jun 2013 19:45:44 +0000 (23:45 +0400)
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: [email protected]
Signed-off-by: Peter Crosthwaite <[email protected]>
Reviewed-by: Andreas Färber <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
hw/char/serial.c

index 0a2b6c9acc444534a72bcee72b746490730df6ff..017610eb454720e1403f266ba1f7ac37b5f0bba3 100644 (file)
@@ -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;
This page took 0.031273 seconds and 4 git commands to generate.