aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2014-09-23 17:38:54 +0530
committerSanjay Singh Rawat <sanjay.rawat@linaro.org>2014-09-24 11:13:22 +0530
commit236ec09723f088735fa679220083a2988686a3b3 (patch)
tree38b45006b5b8a7ba07f3aeedb2eb956724463ac5
parent8849f0099f4ddcab18bad7f97b37122f9bf9a093 (diff)
thermal: always use curly brackets when dereferencing array elements
${array[1]} is the recommended way to dereference array elements in bash. While $array[1] may work with some implementations of bash, it is not guaranteed to work. Signed-off-by: Javi Merino <javi.merino@arm.com> Acked-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org>
-rw-r--r--include/thermal_functions.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/thermal_functions.sh b/include/thermal_functions.sh
index eaf378b..bfc6620 100644
--- a/include/thermal_functions.sh
+++ b/include/thermal_functions.sh
@@ -185,7 +185,7 @@ check_scaling_freq() {
local flag=0
for cpu in $cpus; do
- if [ $before_freq_list[$index] -ne $after_freq_list[$index] ] ; then
+ if [ ${before_freq_list[$index]} -ne ${after_freq_list[$index]} ] ; then
flag=1
fi
index=$((index + 1))
@@ -237,7 +237,7 @@ enable_all_thermal_zones() {
local th_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']")
for zone in $th_zones; do
- echo $mode_list[$index] > $THERMAL_PATH/$zone/mode
+ echo ${mode_list[$index]} > $THERMAL_PATH/$zone/mode
index=$((index + 1))
done
return 0