fix broken kdump_get_arch_recommend_size

shellcheck finds the following problem,
$ shellcheck kdump-lib.sh
In kdump-lib.sh line 876:
        get_recommend_size "$sys_mem" "$ck_cmdline"
                                       ^---------^ SC2154: ck_cmdline is referenced but not assigned (did you mean '_ck_cmdline'?).

s/ck_cmdline/_ck_cmdline to fix kdump_get_arch_recommend_size.

Note s/sys_mem/_sys_mem as well to make the changes consistent.

Fixes: 105c016 ("factor out kdump_get_arch_recommend_crashkernel")
Signed-off-by: Coiby Xu <coxu@redhat.com>
Acked-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
Coiby Xu 2022-01-26 08:48:18 +08:00
parent c67a836cde
commit 2df55984f6

View File

@ -864,16 +864,16 @@ kdump_get_arch_recommend_crashkernel()
# $1: kernel version, if not set, will defaults to $(uname -r) # $1: kernel version, if not set, will defaults to $(uname -r)
kdump_get_arch_recommend_size() kdump_get_arch_recommend_size()
{ {
local _ck_cmdline local _ck_cmdline _sys_mem
if ! [[ -r "/proc/iomem" ]]; then if ! [[ -r "/proc/iomem" ]]; then
echo "Error, can not access /proc/iomem." echo "Error, can not access /proc/iomem."
return 1 return 1
fi fi
sys_mem=$(get_system_size) _sys_mem=$(get_system_size)
_ck_cmdline=$(kdump_get_arch_recommend_crashkernel) _ck_cmdline=$(kdump_get_arch_recommend_crashkernel)
_ck_cmdline=${_ck_cmdline//-:/-102400T:} _ck_cmdline=${_ck_cmdline//-:/-102400T:}
get_recommend_size "$sys_mem" "$ck_cmdline" get_recommend_size "$_sys_mem" "$_ck_cmdline"
} }
# Print all underlying crypt devices of a block device # Print all underlying crypt devices of a block device