arch/x86/ioapic: Allow IOAPIC with only one vector

Remove the test for count=0 that leaked from drivers/generic/ioapic
implementation. See commit ea2fb8d80 and commit 8cc25d229.

Change-Id: I26944b930851fbea160c844ea46e2faa61c9af8e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58423
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c
index 22d979d..d299e60 100644
--- a/src/arch/x86/ioapic.c
+++ b/src/arch/x86/ioapic.c
@@ -35,9 +35,9 @@
 	u8 count;
 
 	reg = io_apic_read(ioapic_base, 0x01);
-	count = reg >> 16;
+	count = (reg >> 16) & 0xff;
 
-	if (!count || count == 0xff)
+	if (count == 0xff)
 		count = 23;
 	count++;
 
@@ -54,7 +54,7 @@
 	u8 count;
 
 	reg = io_apic_read(ioapic_base, 0x01);
-	count = reg >> 16;
+	count = (reg >> 16) & 0xff;
 	if (mre_count > 0)
 		count = mre_count - 1;
 	reg &= ~(0xff << 16);