Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6k1R-00060p-8Q for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:17 -0400 Received: from [140.186.70.92] (port=51307 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6k1P-0005zS-4N for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6k1N-0002lS-CM for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26249) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6k1N-0002lA-1P for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:13 -0400 From: Amit Shah Date: Tue, 27 Apr 2010 18:04:01 +0530 Message-Id: <1272371652-23087-8-git-send-email-amit.shah@redhat.com> In-Reply-To: <1272371652-23087-7-git-send-email-amit.shah@redhat.com> References: <1272371652-23087-1-git-send-email-amit.shah@redhat.com> <1272371652-23087-2-git-send-email-amit.shah@redhat.com> <1272371652-23087-3-git-send-email-amit.shah@redhat.com> <1272371652-23087-4-git-send-email-amit.shah@redhat.com> <1272371652-23087-5-git-send-email-amit.shah@redhat.com> <1272371652-23087-6-git-send-email-amit.shah@redhat.com> <1272371652-23087-7-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH v6 07/18] 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: Anthony Liguori Cc: Amit Shah , qemu list , Juan Quintela 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 8efba0b..c1d9851 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