kdump-lib.sh: fix arithmetic operation syntax

upstream: fedora
resolves: bz2003832
conflict: none

commit c0edb80b8f
Author: Kairui Song <kasong@redhat.com>
Date:   Wed Sep 8 13:31:31 2021 +0800

    kdump-lib.sh: fix arithmetic operation syntax

    Get rid of let, and remove useless '$' on arithmetic variables.

    Signed-off-by: Kairui Song <kasong@redhat.com>
    Acked-by: Philipp Rudo <prudo@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
Tao Liu 2021-11-03 19:26:13 +08:00
parent 6dbf7c2e6c
commit d8f8b09fa0
1 changed files with 4 additions and 4 deletions

View File

@ -768,7 +768,7 @@ get_system_size()
# replace '-' with '+0x' and '+' with '-0x'
sum=$( echo $result | sed -e 's/-/K0x/g' | sed -e 's/+/-0x/g' | sed -e 's/K/+/g' )
size=$(printf "%d\n" $(($sum)))
let size=$size/1024/1024/1024
size=$((size / 1024 / 1024 / 1024))
echo $size
}
@ -794,7 +794,7 @@ get_recommend_size()
size=${end: : -1}
unit=${end: -1}
if [[ $unit == 'T' ]]; then
let size=$size*1024
size=$((size * 1024))
fi
if [[ $mem_size -lt $size ]]; then
echo $recommend
@ -890,7 +890,7 @@ get_vmlinux_size()
local size=0
while read _type _offset _virtaddr _physaddr _fsize _msize _flg _aln; do
size=$(( $size + $_msize ))
size=$(( size + _msize ))
done <<< $(readelf -l -W $1 | grep "^ LOAD" 2>/dev/stderr)
echo $size
@ -945,7 +945,7 @@ get_kernel_size()
# Fallback to use iomem
local _size=0
for _seg in $(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1); do
_size=$(( $_size + 0x${_seg#*-} - 0x${_seg%-*} ))
_size=$(( _size + 0x${_seg#*-} - 0x${_seg%-*} ))
done
echo $_size
}