treewide: use is_enabled_cpu() on cycles over device list

use is_enabled_cpu() on cycles over device list to check
whether the current device is enabled cpu.

TEST: compile test and qemu run successfully with coreinfo
payload

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Change-Id: If64bd18f006b6f5fecef4f606c1df7d3a4d42883
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67797
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 1e13bca..0be6cfb 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -917,10 +917,7 @@
 	int count = 0;
 
 	for (cpu = all_devices; cpu; cpu = cpu->next) {
-		if ((cpu->path.type != DEVICE_PATH_APIC) ||
-		    (cpu->bus->dev->path.type != DEVICE_PATH_CPU_CLUSTER))
-			continue;
-		if (!cpu->enabled)
+		if (!is_enabled_cpu(cpu))
 			continue;
 		count++;
 	}