From patchwork Thu Mar 3 08:02:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 85243 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 537FAB70E6 for ; Thu, 3 Mar 2011 19:05:56 +1100 (EST) Received: from localhost ([127.0.0.1]:49704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pv3Xk-0004sp-Sq for incoming@patchwork.ozlabs.org; Thu, 03 Mar 2011 03:05:52 -0500 Received: from [140.186.70.92] (port=59441 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pv3Ue-0003yQ-Cr for qemu-devel@nongnu.org; Thu, 03 Mar 2011 03:02:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pv3Ud-0001MR-3U for qemu-devel@nongnu.org; Thu, 03 Mar 2011 03:02:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pv3Uc-0001M0-Ma for qemu-devel@nongnu.org; Thu, 03 Mar 2011 03:02:39 -0500 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 p2382a5C031820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Mar 2011 03:02:36 -0500 Received: from localhost (ovpn-113-56.phx2.redhat.com [10.3.113.56]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2382Xmu004406; Thu, 3 Mar 2011 03:02:35 -0500 From: Amit Shah To: qemu list Date: Thu, 3 Mar 2011 13:32:27 +0530 Message-Id: <3a14c34f21319d7885d00bf2737ec62be2193b4e.1299139343.git.amit.shah@redhat.com> 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 , Juan Quintela Subject: [Qemu-devel] [PATCH] 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 8446bc2..9e33a59 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)