Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nu59Y-00011g-Q3 for qemu-devel@nongnu.org; Tue, 23 Mar 2010 10:32:20 -0400 Received: from [199.232.76.173] (port=35890 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nu59Y-00011E-Dx for qemu-devel@nongnu.org; Tue, 23 Mar 2010 10:32:20 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nu59X-0001Wr-C5 for qemu-devel@nongnu.org; Tue, 23 Mar 2010 10:32:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46015) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nu59X-0001Wl-08 for qemu-devel@nongnu.org; Tue, 23 Mar 2010 10:32:19 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2NEWHJm028912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 23 Mar 2010 10:32:18 -0400 From: Amit Shah Date: Tue, 23 Mar 2010 20:00:13 +0530 Message-Id: <1269354619-10201-4-git-send-email-amit.shah@redhat.com> In-Reply-To: <1269354619-10201-3-git-send-email-amit.shah@redhat.com> References: <1269354619-10201-1-git-send-email-amit.shah@redhat.com> <1269354619-10201-2-git-send-email-amit.shah@redhat.com> <1269354619-10201-3-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 3/9] 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 , quintela@redhat.com, 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 f43d1fc..7e9df96 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; -- 1.6.2.5