From dd2b935dc4d6fa2f9f4d9a0765db3245ff905aaf Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 24 Jun 2021 17:09:14 +0200 Subject: [PATCH] check_format: Fixes for shellcheck's SC2268 directive SC2268: Avoid x-prefix in comparisons as it no longer serves a purpose Signed-off-by: Michal Berger Change-Id: Ica5ddfa8c39f34741c7344906abe802ff7451b1f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8505 Reviewed-by: Karol Latecki Reviewed-by: Reviewed-by: Ben Walker Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- test/vhost/fiotest/fio.sh | 2 +- test/vhost/hotplug/common.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/vhost/fiotest/fio.sh b/test/vhost/fiotest/fio.sh index a395ae0c5..bdd992473 100755 --- a/test/vhost/fiotest/fio.sh +++ b/test/vhost/fiotest/fio.sh @@ -119,7 +119,7 @@ rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock" for vm_conf in "${vms[@]}"; do IFS=',' read -ra conf <<< "$vm_conf" - if [[ x"${conf[0]}" == x"" ]] || ! assert_number ${conf[0]}; then + if [[ -z ${conf[0]} ]] || ! assert_number ${conf[0]}; then fail "invalid VM configuration syntax $vm_conf" fi diff --git a/test/vhost/hotplug/common.sh b/test/vhost/hotplug/common.sh index f89b601b4..edf22fae4 100644 --- a/test/vhost/hotplug/common.sh +++ b/test/vhost/hotplug/common.sh @@ -88,7 +88,7 @@ function print_test_fio_header() { function vms_setup() { for vm_conf in "${vms[@]}"; do IFS=',' read -ra conf <<< "$vm_conf" - if [[ x"${conf[0]}" == x"" ]] || ! assert_number ${conf[0]}; then + if [[ -z ${conf[0]} ]] || ! assert_number ${conf[0]}; then fail "invalid VM configuration syntax $vm_conf" fi