From 4eb10bc25e6a48371d4099e7b6ae7807ca44a0f6 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Tue, 26 Nov 2024 14:02:22 -0800 Subject: [PATCH] intel/dev: Don't process hwconfig table to apply items when not required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jordan Justen Reviewed-by: José Roberto de Souza Part-of: --- src/intel/dev/intel_hwconfig.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/intel/dev/intel_hwconfig.c b/src/intel/dev/intel_hwconfig.c index ded6dcbc31f..8401e397993 100644 --- a/src/intel/dev/intel_hwconfig.c +++ b/src/intel/dev/intel_hwconfig.c @@ -172,9 +172,9 @@ should_apply_hwconfig_item(uint16_t always_apply_verx10, const struct intel_device_info *devinfo, uint32_t devinfo_val) { - if (apply_hwconfig(devinfo) && - (devinfo->verx10 >= always_apply_verx10 || devinfo_val == 0)) - return true; + assert(apply_hwconfig(devinfo)); + if ((devinfo->verx10 >= always_apply_verx10 || devinfo_val == 0)) + return true; return false; } @@ -344,7 +344,8 @@ bool intel_hwconfig_process_table(struct intel_device_info *devinfo, void *data, int32_t len) { - process_hwconfig_table(devinfo, data, len, apply_hwconfig_item); + if (apply_hwconfig(devinfo)) + process_hwconfig_table(devinfo, data, len, apply_hwconfig_item); #ifndef NDEBUG process_hwconfig_table(devinfo, data, len, check_hwconfig_item); #endif