meta-facebook: fix up new shellcheck warnings
New docker container is flagging some issues in this shell script:
```
SC2004 (style): $/${} is unnecessary on arithmetic variables.
SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
```
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I9806a097ca417d8677374efd666f2a8865a0a2fd
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor b/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor
index f34e4bd..20a1913 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/plat-svc/files/bletchley-host-state-monitor
@@ -143,18 +143,18 @@
fi
if [ "$HOST_STATE" = "${HOST_PREVIOUS_STATE[$i]}" ]; then
- HOST_STATE_CHANGE_CHECK[$i]="$HOST_STATE_CHANGE_CHECH_CNT"
+ HOST_STATE_CHANGE_CHECK[i]="$HOST_STATE_CHANGE_CHECH_CNT"
elif [ "${HOST_STATE_CHANGE_CHECK[$i]}" -gt "0" ]; then
echo "SLED$i: detected state changed (previous:${HOST_PREVIOUS_STATE[$i]}, current:$HOST_STATE), check count: ${HOST_STATE_CHANGE_CHECK[$i]}"
- HOST_STATE_CHANGE_CHECK[$i]=$((HOST_STATE_CHANGE_CHECK[i]-1))
+ HOST_STATE_CHANGE_CHECK[i]=$((HOST_STATE_CHANGE_CHECK[i]-1))
else
echo "SLED$i: detected state changed, update host state to $HOST_STATE"
update_host_acpi_power_state "$i" "${HOST_ACPI_ST_MAP[$HOST_STATE]}"
update_host_state "$i" "${HOST_STATE_MAP[$HOST_STATE]}"
update_chassis_power_state "$i" "${CHASSIS_PWR_STATE_MAP[$HOST_STATE]}"
update_sled_led_state "$i" "$HOST_STATE"
- HOST_STATE_CHANGE_CHECK[$i]="$HOST_STATE_CHANGE_CHECH_CNT"
- HOST_PREVIOUS_STATE[$i]="$HOST_STATE"
+ HOST_STATE_CHANGE_CHECK[i]="$HOST_STATE_CHANGE_CHECH_CNT"
+ HOST_PREVIOUS_STATE[i]="$HOST_STATE"
fi
done
sleep 1
diff --git a/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite
index d30ed89..46d72f4 100644
--- a/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite
+++ b/meta-facebook/meta-bletchley/recipes-phosphor/sensors/phosphor-nvme/nvme-json-rewrite
@@ -10,13 +10,13 @@
for i in {0..5}
do
- SLED_NVME_PCIE_EN[$i]=0
+ SLED_NVME_PCIE_EN[i]=0
for file in /sys/bus/i2c/drivers/pca953x/"$i"-0041/gpio/gpiochip*/base
do
if [ -f "$file" ]; then
GPIOCHIP_BASE="$(cat /sys/bus/i2c/drivers/pca953x/"$i"-0041/gpio/gpiochip*/base)"
- SLED_NVME_PCIE_EN[$i]=$((GPIOCHIP_BASE+3))
- export_gpio ${SLED_NVME_PCIE_EN[$i]}
+ SLED_NVME_PCIE_EN[i]=$((GPIOCHIP_BASE+3))
+ export_gpio "${SLED_NVME_PCIE_EN[i]}"
break
fi
done