Commit 1ccc878e authored by Karol Latecki's avatar Karol Latecki Committed by Jim Harris
Browse files

scripts: use -n instead of ! -z



Changing according to styling check done by ShellCheck.
Removing from check_format.sh exclusion list:
SC2236 - Use -n instead of ! -z
SC2070 - -n doesn't work with unquoted arguments. Quote or use [[ ]]

Change-Id: Ia9d645b9d0ce31b67c4de682395cf36f4ddc8d1f
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463180


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 73c74528
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ elif hash pep8 2>/dev/null; then
	PEP8=pep8
fi

if [ ! -z ${PEP8} ]; then
if [ -n "${PEP8}" ]; then
	echo -n "Checking Python style..."

	PEP8_ARGS+=" --max-line-length=140"
@@ -243,11 +243,11 @@ if hash shellcheck 2>/dev/null; then
SC1083,SC1087,SC1090,SC1091,SC1113,SC2001,SC2002,SC2003,SC2004,SC2005,\
SC2007,SC2009,SC2010,SC2012,SC2013,SC2015,SC2016,SC2018,SC2019,SC2022,SC2026,\
SC2027,SC2030,SC2031,SC2034,SC2035,SC2039,SC2043,SC2044,SC2045,SC2046,SC2048,\
SC2059,SC2064,SC2068,SC2070,SC2074,SC2086,SC2088,SC2089,SC2090,SC2091,SC2094,\
SC2059,SC2064,SC2068,SC2074,SC2086,SC2088,SC2089,SC2090,SC2091,SC2094,\
SC2097,SC2098,SC2103,SC2115,SC2116,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2145,SC2146,SC2148,SC2152,SC2153,SC2154,SC2155,\
SC2162,SC2164,SC2165,SC2166,SC2167,SC2174,SC2178,SC2181,SC2191,SC2192,SC2195,\
SC2199,SC2206,SC2207,SC2209,SC2214,SC2219,SC2220,SC2223,SC2230,SC2231,SC2233,SC2235,SC2236"
SC2199,SC2206,SC2207,SC2209,SC2214,SC2219,SC2220,SC2223,SC2230,SC2231,SC2233,SC2235"

	SHCK_FORMAT="diff"
	SHCK_APPLY=true
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ if [ "$LTO" = "y" ]; then
	fi
fi

if [ ! -z "$CROSS_PREFIX" ]; then
if [ -n "$CROSS_PREFIX" ]; then
	expected_prefix=$($CC -dumpmachine)

	if [ ! "$expected_prefix" = "$CROSS_PREFIX" ]; then
@@ -182,6 +182,6 @@ echo "CCAR=$CCAR"
echo "CC_TYPE=$CC_TYPE"
echo "LD_TYPE=$LD_TYPE"

if [ ! -z "$CROSS_PREFIX" ]; then
if [ -n "$CROSS_PREFIX" ]; then
	echo "CROSS_PREFIX=$CROSS_PREFIX"
fi
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ if [ ${#qat_pci_bdfs[@]} -eq 0 ]; then
	exit 0
fi

if [ ! -z $1 ]; then
if [ -n "$1" ]; then
	driver_to_bind=$1
fi

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ function usage()
		options="[config|reset|help]"
	fi

	[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
	[[ -n $2 ]] && ( echo "$2"; echo ""; )
	echo "Helper script for allocating hugepages and binding NVMe, I/OAT, VMD and Virtio devices"
	echo "to a generic VFIO kernel driver. If VFIO is not available on the system, this script"
	echo "will fall back to UIO. NVMe and Virtio devices with active mountpoints will be ignored."
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ mkdir -vp "${VAGRANT_TARGET}/${VAGRANT_DISTRO}"
cp "${testdir}/Vagrantfile_openstack_vm" "${VAGRANT_TARGET}/${VAGRANT_DISTRO}/Vagrantfile"

pushd "${VAGRANT_TARGET}/${VAGRANT_DISTRO}"
if [ ! -z "${http_proxy}" ]; then
if [ -n "${http_proxy}" ]; then
	export http_proxy
fi

Loading