yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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