From 479de16f2b4b98077b3de34ec5bb287698dd2dc7 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 27 Oct 2011 10:35:17 +0400 Subject: [PATCH] kvm tools: Use ARRAY_SIZE helper to count serial devices Signed-off-by: Cyrill Gorcunov Signed-off-by: Pekka Enberg --- hw/serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/serial.c b/hw/serial.c index 11fa5d4..67a2007 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -130,9 +130,9 @@ static void serial8250__receive(struct kvm *kvm, struct serial8250_device *dev) void serial8250__inject_interrupt(struct kvm *kvm) { - int i; + unsigned int i; - for (i = 0; i < 4; i++) { + for (i = 0; i < ARRAY_SIZE(devices); i++) { struct serial8250_device *dev = &devices[i]; mutex_lock(&dev->mutex);