From b943f42ef59669b84528fef2b4fee27ad8543b30 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 9 Sep 2024 14:28:05 +0100 Subject: [PATCH] ci/intel-gpu-freq: Fix shellcheck warning SC2319 is actually helpful! It's telling us that in: foo="$(bar)" [ -n "$foo" ] && ret=$? ret actually gets us the return code from [ which is by definition zero, instead of the return code from bar that we wanted. Signed-off-by: Daniel Stone Part-of: --- .gitlab-ci/common/intel-gpu-freq.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/common/intel-gpu-freq.sh b/.gitlab-ci/common/intel-gpu-freq.sh index 8d0166eac40..78d572c37c7 100755 --- a/.gitlab-ci/common/intel-gpu-freq.sh +++ b/.gitlab-ci/common/intel-gpu-freq.sh @@ -560,7 +560,8 @@ set_cpu_freq_max() { read_cpu_freq_info ${cpu_index} n ${CAP_CPU_FREQ_INFO} || { res=$?; continue; } target_freq=$(compute_cpu_freq_set "${CPU_SET_MAX_FREQ}") - [ -z "${target_freq}" ] && { res=$?; continue; } + tf_res=$? + [ -z "${target_freq}" ] && { res=$tf_res; continue; } log INFO "Setting CPU%s max scaling freq to %s Hz" ${cpu_index} "${target_freq}" [ -n "${DRY_RUN}" ] && continue