Patchwork [v5,07/17] virtio-serial: Remove redundant check for 0-sized write request

login
register
mail settings
Submitter Amit Shah
Date April 14, 2010, 5:28 a.m.
Message ID <1271222917-7803-8-git-send-email-amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/50103/
State New
Headers show

Comments

Amit Shah - April 14, 2010, 5:28 a.m.
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 <amit.shah@redhat.com>
---
 hw/virtio-serial-bus.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Patch

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;