kernel_linux_build:Correcting code scan errors

Signed-off-by: liudanning <liudanning@h-partners.com>
This commit is contained in:
liudanning
2022-06-21 10:10:11 +08:00
parent 80d4303357
commit f8815b6ce8
3 changed files with 23 additions and 18 deletions
@@ -46,26 +46,30 @@ do_test()
init_value3=$(cat $_ssr_path/hc_hot_node_lower_limit)
init_value4=$(cat $_ssr_path/hc_warm_node_lower_limit)
confirm_value hc_hot_data_lower_limit
confirm_value hc_warm_data_lower_limit
confirm_value hc_hot_node_lower_limit
confirm_value hc_hot_data_lower_limit &&
confirm_value hc_warm_data_lower_limit &&
confirm_value hc_hot_node_lower_limit &&
confirm_value hc_warm_node_lower_limit
[ $? -ne 0 ] && ((ret++))
echo 6000000 > $_ssr_path/hc_hot_data_lower_limit
echo 6000000 > $_ssr_path/hc_warm_data_lower_limit
echo 6000000 > $_ssr_path/hc_hot_node_lower_limit
echo 6000000 > $_ssr_path/hc_warm_node_lower_limit
confirm_change_value hc_hot_data_lower_limit
confirm_change_value hc_warm_data_lower_limit
confirm_change_value hc_hot_node_lower_limit
confirm_change_value hc_hot_data_lower_limit &&
confirm_change_value hc_warm_data_lower_limit &&
confirm_change_value hc_hot_node_lower_limit &&
confirm_change_value hc_warm_node_lower_limit
[ $? -ne 0 ] && ((ret++))
if [ $ret -eq 0 ];then
tst_res TPASS "hierarchical SSR threshold configuration interface pass."
else
tst_res TFAIL "Hierarchical SSR threshold configuration interface failed!"
fi
tst_res TPASS "hierarchical SSR threshold configuration interface pass."
else
tst_res TFAIL "Hierarchical SSR threshold configuration interface failed!"
fi
}
confirm_value()
@@ -73,9 +77,10 @@ confirm_value()
local result_out1=$(cat /sys/fs/f2fs/loop1/$1)
if [ "$result_out1" == "5242880" ]; then
tst_res TPASS "$1 is 5242880 expected."
return 0
else
tst_res TFAIL "$1 is not 5242880 unexpected!"
ret=$(( $ret + 1 ))
return 1
fi
}
@@ -86,7 +91,7 @@ confirm_change_value()
tst_res TPASS "$1 is 6000000 expected."
else
tst_res TFAIL "$1 is not 6000000 unexpected!"
ret=$(( $ret + 1 ))
return 0
fi
}
@@ -96,7 +101,7 @@ do_clean()
echo $init_value2 > $_ssr_path/hc_warm_data_lower_limit
echo $init_value3 > $_ssr_path/hc_hot_node_lower_limit
echo $init_value4 > $_ssr_path/hc_warm_node_lower_limit
losetup -d /dev/block/loop1
losetup -d /dev/block/loop1
umount /mnt/f2fs_mount
}
@@ -100,7 +100,7 @@ do_clean()
echo $init_value2 > $_ssr_path/hc_warm_data_waterline
echo $init_value3 > $_ssr_path/hc_hot_node_waterline
echo $init_value4 > $_ssr_path/hc_warm_node_waterline
losetup -d /dev/block/loop1
losetup -d /dev/block/loop1
umount /mnt/f2fs_mount
}
@@ -34,20 +34,20 @@ hp_init()
{
dd if=/dev/random of=/data/hpdisk bs=4096 count=131072
losetup /dev/block/loop6 /data/hpdisk
hyperhold_device=`cat /proc/sys/kernel/hyperhold/device`
hyperhold_device=$(cat /proc/sys/kernel/hyperhold/device)
echo /dev/block/loop6 > /proc/sys/kernel/hyperhold/device
}
hp_enable()
{
hyperhold_enable=`cat /proc/sys/kernel/hyperhold/enable`
hyperhold_enable=$(cat /proc/sys/kernel/hyperhold/enable)
echo enable > /proc/sys/kernel/hyperhold/enable
}
zram_init()
{
zram0_group=`cat /sys/block/zram0/group`
zram0_disksize=`cat /sys/block/zram0/disksize`
zram0_group=$(cat /sys/block/zram0/group)
zram0_disksize=$(cat /sys/block/zram0/disksize)
echo readwrite > /sys/block/zram0/group
echo 512M > /sys/block/zram0/disksize
}