From ca4164e629a8162dc6b297c13a725a9f2b3ee4eb Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Sun, 26 Jul 2020 09:25:04 +0200 Subject: soc/intel/jasperlake: Simplify is-device-enabled checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplify if-statements and use is_dev_enabled() where possible. Change-Id: I744939bee3d51ac25c1cc2dcd3359fe571c9e408 Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/43898 Reviewed-by: Tim Wawrzynczak Reviewed-by: Michael Niewöhner Tested-by: build bot (Jenkins) --- src/soc/intel/jasperlake/acpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/soc/intel/jasperlake/acpi.c') diff --git a/src/soc/intel/jasperlake/acpi.c b/src/soc/intel/jasperlake/acpi.c index 5911a2f875..8673da17ea 100644 --- a/src/soc/intel/jasperlake/acpi.c +++ b/src/soc/intel/jasperlake/acpi.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -187,7 +188,7 @@ static unsigned long soc_fill_dmar(unsigned long current) uint64_t gfxvtbar = MCHBAR64(GFXVTBAR) & VTBAR_MASK; bool gfxvten = MCHBAR32(GFXVTBAR) & VTBAR_ENABLED; - if (igfx_dev && igfx_dev->enabled && gfxvtbar && gfxvten) { + if (is_dev_enabled(igfx_dev) && gfxvtbar && gfxvten) { unsigned long tmp = current; current += acpi_create_dmar_drhd(current, 0, 0, gfxvtbar); @@ -200,7 +201,7 @@ static unsigned long soc_fill_dmar(unsigned long current) uint64_t ipuvtbar = MCHBAR64(IPUVTBAR) & VTBAR_MASK; bool ipuvten = MCHBAR32(IPUVTBAR) & VTBAR_ENABLED; - if (ipu_dev && ipu_dev->enabled && ipuvtbar && ipuvten) { + if (is_dev_enabled(ipu_dev) && ipuvtbar && ipuvten) { unsigned long tmp = current; current += acpi_create_dmar_drhd(current, 0, 0, ipuvtbar); -- cgit v1.2.3