thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-char-serial-serial_ioport_write-Factor-out-common-co.patch

619821
From e675e8ae59a4eb6a39fa9d1f13011fd4e718ce67 Mon Sep 17 00:00:00 2001
b28c64
From: Fam Zheng <famz@redhat.com>
619821
Date: Thu, 18 May 2017 09:21:16 +0200
b28c64
Subject: [PATCH 03/18] char/serial: serial_ioport_write: Factor out common
b28c64
 code
b28c64
MIME-Version: 1.0
b28c64
Content-Type: text/plain; charset=UTF-8
b28c64
Content-Transfer-Encoding: 8bit
b28c64
b28c64
RH-Author: Fam Zheng <famz@redhat.com>
619821
Message-id: <20170518092131.16571-4-famz@redhat.com>
619821
Patchwork-id: 75295
619821
O-Subject: [RHEL-7.4 qemu-kvm PATCH v3 03/18] char/serial: serial_ioport_write: Factor out common code
619821
Bugzilla: 1451470
b28c64
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
619821
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
b28c64
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
b28c64
b28c64
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
b28c64
b28c64
These three lines are common to both FIFO and regular mode. Just factor
b28c64
them out to outside the if rather than replicate the same lines inside
b28c64
both if and else.
b28c64
b28c64
Cc: qemu-trivial@nongnu.org
b28c64
b28c64
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
b28c64
Reviewed-by: Andreas Färber <afaerber@suse.de>
b28c64
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
b28c64
(cherry picked from commit b5601df7624b461759651c49ac72a189951780b9)
b28c64
Signed-off-by: Fam Zheng <famz@redhat.com>
b28c64
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
b28c64
---
b28c64
 hw/char/serial.c | 10 +++-------
b28c64
 1 file changed, 3 insertions(+), 7 deletions(-)
b28c64
b28c64
diff --git a/hw/char/serial.c b/hw/char/serial.c
b28c64
index 0d4450e..72112cc 100644
b28c64
--- a/hw/char/serial.c
b28c64
+++ b/hw/char/serial.c
b28c64
@@ -286,15 +286,11 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val,
b28c64
                     fifo8_pop(&s->xmit_fifo);
b28c64
                 }
b28c64
                 fifo8_push(&s->xmit_fifo, s->thr);
b28c64
-                s->thr_ipending = 0;
b28c64
                 s->lsr &= ~UART_LSR_TEMT;
b28c64
-                s->lsr &= ~UART_LSR_THRE;
b28c64
-                serial_update_irq(s);
b28c64
-            } else {
b28c64
-                s->thr_ipending = 0;
b28c64
-                s->lsr &= ~UART_LSR_THRE;
b28c64
-                serial_update_irq(s);
b28c64
             }
b28c64
+            s->thr_ipending = 0;
b28c64
+            s->lsr &= ~UART_LSR_THRE;
b28c64
+            serial_update_irq(s);
b28c64
             serial_xmit(NULL, G_IO_OUT, s);
b28c64
         }
b28c64
         break;
b28c64
-- 
b28c64
1.8.3.1
b28c64