Skip to contentSkip to conversation

cadence_uart: Handle backend tx errors

PATCH In review [email protected] 2 participants 2 messages Jun 19, 2013 – Jun 20, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cadence_uart: Handle backend tx errors

From: "Edgar E. Iglesias" <[email protected]>

---

v1 -> v2:
Remove loop around qemu_chr_fe_write_all, it does not return short writes.

 hw/char/cadence_uart.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/char/cadence_uart.c +1 -3
index c2a7834..205e125 100644
@@ -297,9 +297,7 @@ static void uart_write_tx_fifo(UartState *s, const uint8_t *buf, int size)
         return;
     }
 
-    while (size) {
-        size -= qemu_chr_fe_write(s->chr, buf, size);
-    }
+    qemu_chr_fe_write_all(s->chr, buf, size);
 }
 
 static void uart_receive(void *opaque, const uint8_t *buf, int size)
Signature · 1 line
1.7.10.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · On Thu, Jun 20, 2013 at 12:20 AM, <[email protected]> wrote:

From: "Edgar E. Iglesias" <[email protected]>

Thanks!

Regards,
Peter

Quoted 27 lines

---

v1 -> v2:
Remove loop around qemu_chr_fe_write_all, it does not return short writes.

 hw/char/cadence_uart.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/char/cadence_uart.c +1 -4
index c2a7834..205e125 100644
@@ -297,9 +297,7 @@ static void uart_write_tx_fifo(UartState *s, const uint8_t *buf, int size)
         return;
     }
 
-    while (size) {
-        size -= qemu_chr_fe_write(s->chr, buf, size);
-    }
+    qemu_chr_fe_write_all(s->chr, buf, size);
 }
 
 static void uart_receive(void *opaque, const uint8_t *buf, int size)
--

1.7.10.4