As suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2219
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-module-setup.sh | 2 +-
kdumpctl | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index bf02164c..8b9911d0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -196,7 +196,7 @@ cal_netmask_by_prefix() {
_res="$_first_part"
_tmp=$((_octets_total*_bits_per_octet-_prefix))
- _zero_bits=$(expr $_tmp % $_bits_per_group)
+ _zero_bits=$((_tmp % _bits_per_group))
if [[ "$_zero_bits" -ne 0 ]]; then
_second_part=$((_max_group_value >> _zero_bits << _zero_bits))
if ((_ipv6)); then
diff --git a/kdumpctl b/kdumpctl
index dbac53c3..7602c43e 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -772,7 +772,7 @@ check_and_wait_network_ready()
fi
cur=$(date +%s)
- let "diff = $cur - $start_time"
+ diff=$((cur - start_time))
# 60s time out
if [ $diff -gt 180 ]; then
break;
@@ -835,7 +835,7 @@ show_reserved_mem()
local mem_mb
mem=$(</sys/kernel/kexec_crash_size)
- mem_mb=$(expr "$mem" / 1024 / 1024)
+ mem_mb=$((mem / 1024 / 1024))
dinfo "Reserved "$mem_mb"MB memory for crash kernel"
}
--
2.31.1