From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuRvh-0001mx-GP for qemu-devel@nongnu.org; Wed, 24 Mar 2010 10:51:33 -0400 Received: from [140.186.70.92] (port=60844 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuRva-0001jV-Qd for qemu-devel@nongnu.org; Wed, 24 Mar 2010 10:51:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuRvX-0006T8-Gh for qemu-devel@nongnu.org; Wed, 24 Mar 2010 10:51:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5381) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuRvX-0006Sv-1J for qemu-devel@nongnu.org; Wed, 24 Mar 2010 10:51:23 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2OEpMMP013279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Mar 2010 10:51:22 -0400 From: Amit Shah Date: Wed, 24 Mar 2010 20:19:25 +0530 Message-Id: <1269442173-18421-8-git-send-email-amit.shah@redhat.com> In-Reply-To: <1269442173-18421-7-git-send-email-amit.shah@redhat.com> References: <1269442173-18421-1-git-send-email-amit.shah@redhat.com> <1269442173-18421-2-git-send-email-amit.shah@redhat.com> <1269442173-18421-3-git-send-email-amit.shah@redhat.com> <1269442173-18421-4-git-send-email-amit.shah@redhat.com> <1269442173-18421-5-git-send-email-amit.shah@redhat.com> <1269442173-18421-6-git-send-email-amit.shah@redhat.com> <1269442173-18421-7-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 07/15] virtio-serial: Remove redundant check for 0-sized write request List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Juan Quintela , Gerd Hoffmann , "Michael S. Tsirkin" 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 80f0259..4435c62 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -91,9 +91,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; -- 1.6.2.5