From patchwork Fri Mar 19 11:58:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 48141 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 CB923B6ED0 for ; Fri, 19 Mar 2010 23:12:37 +1100 (EST) Received: from localhost ([127.0.0.1]:53104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nsb3p-0004em-Qn for incoming@patchwork.ozlabs.org; Fri, 19 Mar 2010 08:12:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NsatI-0001EH-8B for qemu-devel@nongnu.org; Fri, 19 Mar 2010 08:01:24 -0400 Received: from [199.232.76.173] (port=35595 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsatG-0001Ds-8T for qemu-devel@nongnu.org; Fri, 19 Mar 2010 08:01:22 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nsat9-0004lF-PP for qemu-devel@nongnu.org; Fri, 19 Mar 2010 08:01:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27760) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nsat9-0004kz-9j for qemu-devel@nongnu.org; Fri, 19 Mar 2010 08:01:15 -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.13.8/8.13.8) with ESMTP id o2JC0Yhm017870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Mar 2010 08:00:35 -0400 Received: from localhost (vpn-235-201.phx2.redhat.com [10.3.235.201]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2JC0WQA032458; Fri, 19 Mar 2010 08:00:33 -0400 From: Amit Shah To: qemu-devel@nongnu.org Date: Fri, 19 Mar 2010 17:28:43 +0530 Message-Id: <1268999926-29560-7-git-send-email-amit.shah@redhat.com> In-Reply-To: <1268999926-29560-6-git-send-email-amit.shah@redhat.com> References: <1268999926-29560-1-git-send-email-amit.shah@redhat.com> <1268999926-29560-2-git-send-email-amit.shah@redhat.com> <1268999926-29560-3-git-send-email-amit.shah@redhat.com> <1268999926-29560-4-git-send-email-amit.shah@redhat.com> <1268999926-29560-5-git-send-email-amit.shah@redhat.com> <1268999926-29560-6-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah , quintela@redhat.com, mst@redhat.com, kraxel@redhat.com, virtualization@lists.linux-foundation.org Subject: [Qemu-devel] [PATCH 6/9] virtio-serial: Remove redundant check for 0-sized write request 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 The check for a 0-sized write request to a guest port is not necessary; the while loop below won't be executed in this case and all will be fine. Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 19e8c59..2603dcd 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -83,9 +83,6 @@ static size_t write_to_port(VirtIOSerialPort *port, if (!virtio_queue_ready(vq)) { return 0; } - if (!size) { - return 0; - } while (offset < size) { int i;