From f2d8dc88eae1bedeac2e73c59b655c8cc60526d2 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 30 May 2010 23:15:28 +0400 Subject: [PATCH] early_printk: Simplify the code Signed-off-by: Cyrill Gorcunov --- early_printk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/early_printk.c b/early_printk.c index cb2f75e..90e2fac 100644 --- a/early_printk.c +++ b/early_printk.c @@ -14,11 +14,11 @@ static int early_serial_base = 0x3f8; /* ttyS0 */ static bool early_serial_txr_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) { char *p = data; - uint32_t i; + int i; - for (i = 0; i < count; i++) { - fprintf(stderr, "%c", *p); - p += size; + while (count--) { + for (i = 0; i < size; i++) + fprintf(stderr, "%c", *p++); } fflush(stderr);