Mailing List Archive

reorganize code to avoid duplication
# HG changeset patch
# User vhanquez@kneesa.uk.xensource.com
# Node ID 7ab6ddd6ada91c7c89081206b20c18e76b88a8fa
# Parent 9270bb6b0421556d4511ad059ef16461145633a5
reorganize code to avoid duplication

Signed-off-by: Vincent Hanquez <vincent@xensource.com>

diff -r 9270bb6b0421 -r 7ab6ddd6ada9 linux-2.6-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c Sat Dec 31 14:20:01 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c Sat Dec 31 15:58:44 2005
@@ -314,39 +314,31 @@
{
int sent, sz, work_done = 0;

- if (xen_start_info->flags & SIF_INITDOMAIN) {
- if (x_char) {
+ if (x_char) {
+ if (xen_start_info->flags & SIF_INITDOMAIN) {
+ while (x_char)
+ if (xencons_ring_send(&x_char, 1) == 1)
+ break;
+ } else
kcons_write_dom0(NULL, &x_char, 1);
- x_char = 0;
- work_done = 1;
- }
-
- while (wc != wp) {
- sz = wp - wc;
- if (sz > (wbuf_size - WBUF_MASK(wc)))
- sz = wbuf_size - WBUF_MASK(wc);
+ x_char = 0;
+ work_done = 1;
+ }
+
+ while (wc != wp) {
+ sz = wp - wc;
+ if (sz > (wbuf_size - WBUF_MASK(wc)))
+ sz = wbuf_size - WBUF_MASK(wc);
+ if (xen_start_info->flags & SIF_INITDOMAIN) {
kcons_write_dom0(NULL, &wbuf[WBUF_MASK(wc)], sz);
wc += sz;
- work_done = 1;
- }
- } else {
- while (x_char) {
- if (xencons_ring_send(&x_char, 1) == 1) {
- x_char = 0;
- work_done = 1;
- }
- }
-
- while (wc != wp) {
- sz = wp - wc;
- if (sz > (wbuf_size - WBUF_MASK(wc)))
- sz = wbuf_size - WBUF_MASK(wc);
+ } else {
sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz);
if (sent == 0)
break;
wc += sent;
- work_done = 1;
}
+ work_done = 1;
}

if (work_done && (xencons_tty != NULL)) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog