From patchwork Wed Mar 24 14:49:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [07/15] virtio-serial: Remove redundant check for 0-sized write request Date: Wed, 24 Mar 2010 04:49:25 -0000 From: Amit Shah X-Patchwork-Id: 48427 Message-Id: <1269442173-18421-8-git-send-email-amit.shah@redhat.com> 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;