Commit 9a4a87b5 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Jim Harris
Browse files

test: Shellcheck - correct rule: $/${} is unnecessary on arithmetic variables.



Correct shellcheck rule SC2004: $/${} is unnecessary on arithmetic variables.

Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ibf2879360bc50cc058b0f4434a5777c53c0eeffb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473265


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 08a71404
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ if hash shellcheck 2>/dev/null; then
	# go to: https://trello.com/c/29Z90j1W
	# Error descriptions can also be found at: https://github.com/koalaman/shellcheck/wiki
	# This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors.
	SHCK_EXCLUDE="SC1083,SC2002,SC2004,\
	SHCK_EXCLUDE="SC1083,SC2002,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2119,SC2120,SC2121,SC2124,SC2126,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2154,SC2155,SC2162"
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ function configure_performance() {
	echo -n "Moving all interrupts off of core 0..."
	count=$(($(nproc) / 4))
	cpumask="e"
	for ((i=1; i<$count; i++)); do
	for ((i=1; i<count; i++)); do
		if [ $((i % 8)) -eq 0 ]; then
			cpumask=",$cpumask"
		fi
+2 −2
Original line number Diff line number Diff line
@@ -388,7 +388,7 @@ function configure_linux {

		MEMLOCK_AMNT=$(ulimit -l)
		if [ "$MEMLOCK_AMNT" != "unlimited" ] ; then
			MEMLOCK_MB=$(( $MEMLOCK_AMNT / 1024 ))
			MEMLOCK_MB=$(( MEMLOCK_AMNT / 1024 ))
			echo ""
			echo "Current user memlock limit: ${MEMLOCK_MB} MB"
			echo ""
@@ -709,7 +709,7 @@ fi

if [ $(uname) = Linux ]; then
	HUGEPGSZ=$(( $(grep Hugepagesize /proc/meminfo | cut -d : -f 2 | tr -dc '0-9') ))
	HUGEPGSZ_MB=$(( $HUGEPGSZ / 1024 ))
	HUGEPGSZ_MB=$(( HUGEPGSZ / 1024 ))
	: ${NRHUGE=$(( (HUGEMEM + HUGEPGSZ_MB - 1) / HUGEPGSZ_MB ))}

	if [ "$mode" == "config" ]; then
+2 −2
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ function create_nv_cache_bdev() {
	local chunk_size=$(get_chunk_size $ocssd_bdf)

	# We need at least 2 bands worth of data + 1 block
	local size=$((2 * 4096 * $chunk_size * $num_punits + 1))
	local size=$((2 * 4096 * chunk_size * num_punits + 1))
	# Round the size up to the nearest megabyte
	local size=$((($size + $bytes_to_mb) / $bytes_to_mb))
	local size=$(((size + bytes_to_mb) / bytes_to_mb))

	# Create NVMe bdev on specified device and split it so that it has the desired size
	local nvc_bdev=$($rootdir/scripts/rpc.py bdev_nvme_attach_controller -b $name -t PCIe -a $cache_bdf)
+2 −2
Original line number Diff line number Diff line
@@ -33,10 +33,10 @@ restore_kill() {
trap "restore_kill; exit 1" SIGINT SIGTERM EXIT

chunk_size=$(get_chunk_size $device)
pu_count=$(($pu_end - $pu_start + 1))
pu_count=$((pu_end - pu_start + 1))

# Write one band worth of data + one extra chunk
data_size=$(($chunk_size * ($pu_count + 1)))
data_size=$((chunk_size * (pu_count + 1)))

$rootdir/app/spdk_tgt/spdk_tgt & svcpid=$!
waitforlisten $svcpid
Loading