From 45aae7f10ff2b2fc6a947eb2667eb658188d3b52 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 23 Sep 2022 16:51:34 +0200 Subject: 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 Change-Id: If64bd18f006b6f5fecef4f606c1df7d3a4d42883 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67797 Reviewed-by: Tim Wawrzynczak Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/soc/intel/xeon_sp/cpx/soc_acpi.c | 6 +----- src/soc/intel/xeon_sp/nb_acpi.c | 6 +----- src/soc/intel/xeon_sp/skx/soc_acpi.c | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) (limited to 'src/soc/intel/xeon_sp') diff --git a/src/soc/intel/xeon_sp/cpx/soc_acpi.c b/src/soc/intel/xeon_sp/cpx/soc_acpi.c index 0d102a13a6..d6e7cf0c87 100644 --- a/src/soc/intel/xeon_sp/cpx/soc_acpi.c +++ b/src/soc/intel/xeon_sp/cpx/soc_acpi.c @@ -224,11 +224,7 @@ unsigned long xeonsp_acpi_create_madt_lapics(unsigned long current) uint8_t num_cpus = 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; current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, num_cpus, cpu->path.apic.apic_id); diff --git a/src/soc/intel/xeon_sp/nb_acpi.c b/src/soc/intel/xeon_sp/nb_acpi.c index b3e4575f4d..64851f5bbc 100644 --- a/src/soc/intel/xeon_sp/nb_acpi.c +++ b/src/soc/intel/xeon_sp/nb_acpi.c @@ -25,11 +25,7 @@ unsigned long acpi_create_srat_lapics(unsigned long current) unsigned int cpu_index = 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; printk(BIOS_DEBUG, "SRAT: lapic cpu_index=%02x, node_id=%02x, apic_id=%02x\n", cpu_index, cpu->path.apic.node_id, cpu->path.apic.apic_id); diff --git a/src/soc/intel/xeon_sp/skx/soc_acpi.c b/src/soc/intel/xeon_sp/skx/soc_acpi.c index 23bb6d6e3c..621e755636 100644 --- a/src/soc/intel/xeon_sp/skx/soc_acpi.c +++ b/src/soc/intel/xeon_sp/skx/soc_acpi.c @@ -155,11 +155,7 @@ unsigned long xeonsp_acpi_create_madt_lapics(unsigned long current) uint8_t num_cpus = 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; current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, num_cpus, cpu->path.apic.apic_id); -- cgit v1.2.3