From patchwork Mon Mar 21 13:09:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 87773 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6EFFAB6F7A for ; Tue, 22 Mar 2011 00:15:13 +1100 (EST) Received: from localhost ([127.0.0.1]:47064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1ewv-0007lL-P2 for incoming@patchwork.ozlabs.org; Mon, 21 Mar 2011 09:15:09 -0400 Received: from [140.186.70.92] (port=40639 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1ere-00058K-5z for qemu-devel@nongnu.org; Mon, 21 Mar 2011 09:09:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1erc-0007PT-4Z for qemu-devel@nongnu.org; Mon, 21 Mar 2011 09:09:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1erb-0007PN-Q6 for qemu-devel@nongnu.org; Mon, 21 Mar 2011 09:09:40 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2LD9cwY012349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Mar 2011 09:09:38 -0400 Received: from localhost (dhcp193-58.pnq.redhat.com [10.65.193.58]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2LD9aPl027235; Mon, 21 Mar 2011 09:09:37 -0400 From: Amit Shah To: Anthony Liguori Date: Mon, 21 Mar 2011 18:39:19 +0530 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Amit Shah , qemu list Subject: [Qemu-devel] [PATCH 4/7] virtio-serial-bus: Simplify handle_output() function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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)