From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41277 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxZ45-0003cX-T2 for qemu-devel@nongnu.org; Thu, 10 Mar 2011 01:09:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxZ44-0007dF-Os for qemu-devel@nongnu.org; Thu, 10 Mar 2011 01:09:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxZ44-0007cz-Gd for qemu-devel@nongnu.org; Thu, 10 Mar 2011 01:09:36 -0500 From: Amit Shah Date: Thu, 10 Mar 2011 11:39:18 +0530 Message-Id: <510881da231fc2e2905087d85287cb1d60fea97d.1299737220.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PULL (resend, rebase) 4/5] virtio-serial-bus: Simplify handle_output() function List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Amit Shah , qemu list There's no code change, just re-arrangement to simplify the function after recent modifications. Reported-by: Juan Quintela Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index c6feb43..a82fbe9 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -442,25 +442,19 @@ static void handle_output(VirtIODevice *vdev, VirtQueue *vq) { VirtIOSerial *vser; VirtIOSerialPort *port; - bool discard; vser = DO_UPCAST(VirtIOSerial, vdev, vdev); port = find_port_by_vq(vser, vq); - discard = false; if (!port || !port->host_connected || !port->info->have_data) { - discard = true; - } - - if (discard) { discard_vq_data(vq, vdev); return; } - if (port->throttled) { + + if (!port->throttled) { + do_flush_queued_data(port, vq, vdev); return; } - - do_flush_queued_data(port, vq, vdev); } static void handle_input(VirtIODevice *vdev, VirtQueue *vq) -- 1.7.4