From 9fe4518d3dafa11691a2039d1b52d230ae636e1e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 30 Aug 2022 10:48:49 -0700 Subject: util/flash_ec: Fix shellcheck warnings servo_v4_with_ccd_cr50_VARS=( "cold_reset" ) ^-------------------------^ SC2034: servo_v4_with_ccd_cr50_VARS appears unused. Verify use (or export if used externally). c2d2_VARS=( "cold_reset" ) ^-------^ SC2034: c2d2_VARS appears unused. Verify use (or export if used externally). servo_v3_VARS=( "${servo_v2_VARS[@]}" ) ^-----------^ SC2034: servo_v3_VARS appears unused. Verify use (or export if used externally). servo_v4_with_servo_micro_VARS=( "${servo_micro_VARS[@]}" ) ^----------------------------^ SC2034: servo_v4_with_servo_micro_VARS appears unused. Verify use (or export if used externally). The variables are actually used, but they are all set to "cold_reset". Simplify the logic by using "cold_reset" directly. BRANCH=none BUG=b:242127759 TEST=./util/flash_ec --board=dartmonkey Signed-off-by: Tom Hughes Change-Id: I97dfb5120dfb29002314b789668ee4c5c12dc410 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3864977 Reviewed-by: Andrea Grandi --- util/flash_ec | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/util/flash_ec b/util/flash_ec index c4112f31f1..7158feedc8 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -780,17 +780,6 @@ function servo_ec_uart() { echo "${PTY}" } -# Not every control is supported on every servo type. Therefore, define which -# controls are supported by each servo type. -servo_v2_VARS=( "cold_reset" ) -servo_micro_VARS=( "cold_reset" ) -servo_v4_with_ccd_cr50_VARS=( "cold_reset" ) -c2d2_VARS=( "cold_reset" ) - -# Some servo boards use the same controls. -servo_v3_VARS=( "${servo_v2_VARS[@]}" ) -servo_v4_with_servo_micro_VARS=( "${servo_micro_VARS[@]}" ) - declare -a save ####################################### @@ -819,10 +808,7 @@ function servo_save_add() { } function servo_save() { - local SERVO_VARS_NAME="${SERVO_TYPE}_VARS[@]" - for ctrl in "${!SERVO_VARS_NAME}"; do - servo_save_add "${ctrl}" - done + servo_save_add "cold_reset" if [[ "${SERVO_TYPE}" == "servo_v2" ]]; then servo_save_add "i2c_mux_en" -- cgit v1.2.1