ShellCheck - shell script analysis tool version: 0.11.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.vZb4yT0of8 and /tmp/tmp.hFXjgIXhDr Tree base: e454cde0a574 ("virtio_net: add page pool support for buffer allocation") Now at: 272dfbc724ba ("selftests: virtio_net: add buffer circulation test") ====== Checking before the patch ====== Checking tools/testing/selftests/drivers/net/virtio_net/basic_features.sh - d12f83d96304bf8b59f399081e4d8bb6acc28f7ddda788a8857d3f40bd18ca51 In basic_features.sh line 6: ALL_TESTS=" ^-------^ SC2034 (warning): ALL_TESTS appears unused. Verify use (or export if used externally). In basic_features.sh line 21: simple_if_init $h1 $H1_IPV4/24 $H1_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_init "$h1" $H1_IPV4/24 $H1_IPV6/64 In basic_features.sh line 24: h1_destroy() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 26: simple_if_fini $h1 $H1_IPV4/24 $H1_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_fini "$h1" "$H1_IPV4"/24 "$H1_IPV6"/64 In basic_features.sh line 31: simple_if_init $h2 $H2_IPV4/24 $H2_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_init "$h2" $H2_IPV4/24 $H2_IPV6/64 In basic_features.sh line 34: h2_destroy() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 36: simple_if_fini $h2 $H2_IPV4/24 $H2_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_fini "$h2" "$H2_IPV4"/24 "$H2_IPV6"/64 In basic_features.sh line 39: initial_ping_test() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 43: ping_test $h1 $H2_IPV4 " simple" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ping_test "$h1" "$H2_IPV4" " simple" In basic_features.sh line 46: f_mac_test() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 48: RET=0 ^-^ SC2034 (warning): RET appears unused. Verify use (or export if used externally). In basic_features.sh line 51: virtio_feature_present $h1 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_feature_present "$h1" "$VIRTIO_NET_F_MAC" In basic_features.sh line 52: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In basic_features.sh line 56: virtio_feature_present $h1 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_feature_present "$h1" "$VIRTIO_NET_F_MAC" In basic_features.sh line 57: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In basic_features.sh line 65: grep -q 0 /sys/class/net/$h1/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h1"/addr_assign_type In basic_features.sh line 67: grep -q 0 /sys/class/net/$h2/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h2"/addr_assign_type In basic_features.sh line 71: virtio_filter_feature_add $h1 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_feature_add "$h1" "$VIRTIO_NET_F_MAC" In basic_features.sh line 72: virtio_filter_feature_add $h2 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_feature_add "$h2" "$VIRTIO_NET_F_MAC" In basic_features.sh line 75: grep -q 0 /sys/class/net/$h1/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h1"/addr_assign_type In basic_features.sh line 77: grep -q 0 /sys/class/net/$h2/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h2"/addr_assign_type In basic_features.sh line 80: ping_do $h1 $H2_IPV4 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ping_do "$h1" "$H2_IPV4" In basic_features.sh line 88: virtio_device_rebind $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h1" In basic_features.sh line 89: virtio_device_rebind $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h2" In basic_features.sh line 90: wait_for_dev $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h1" In basic_features.sh line 91: wait_for_dev $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h2" In basic_features.sh line 99: setup_cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 106: virtio_filter_features_clear $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_features_clear "$h1" In basic_features.sh line 107: virtio_filter_features_clear $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_features_clear "$h2" In basic_features.sh line 108: virtio_device_rebind $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h1" In basic_features.sh line 109: virtio_device_rebind $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h2" In basic_features.sh line 110: wait_for_dev $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h1" In basic_features.sh line 111: wait_for_dev $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h2" In basic_features.sh line 114: cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 120: check_driver $h1 "virtio_net" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_driver "$h1" "virtio_net" In basic_features.sh line 121: check_driver $h2 "virtio_net" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_driver "$h2" "virtio_net" In basic_features.sh line 122: check_virtio_debugfs $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_virtio_debugfs "$h1" In basic_features.sh line 123: check_virtio_debugfs $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_virtio_debugfs "$h2" For more information: https://www.shellcheck.net/wiki/SC2034 -- ALL_TESTS appears unused. Verify ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2329 -- This function is never invoked. C... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/drivers/net/virtio_net/basic_features.sh - d12f83d96304bf8b59f399081e4d8bb6acc28f7ddda788a8857d3f40bd18ca51 In basic_features.sh line 6: ALL_TESTS=" ^-------^ SC2034 (warning): ALL_TESTS appears unused. Verify use (or export if used externally). In basic_features.sh line 24: simple_if_init $h1 $H1_IPV4/24 $H1_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_init "$h1" $H1_IPV4/24 $H1_IPV6/64 In basic_features.sh line 27: h1_destroy() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 29: simple_if_fini $h1 $H1_IPV4/24 $H1_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_fini "$h1" "$H1_IPV4"/24 "$H1_IPV6"/64 In basic_features.sh line 34: simple_if_init $h2 $H2_IPV4/24 $H2_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_init "$h2" $H2_IPV4/24 $H2_IPV6/64 In basic_features.sh line 37: h2_destroy() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 39: simple_if_fini $h2 $H2_IPV4/24 $H2_IPV6/64 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: simple_if_fini "$h2" "$H2_IPV4"/24 "$H2_IPV6"/64 In basic_features.sh line 42: initial_ping_test() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 46: ping_test $h1 $H2_IPV4 " simple" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ping_test "$h1" "$H2_IPV4" " simple" In basic_features.sh line 49: f_mac_test() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 54: virtio_feature_present $h1 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_feature_present "$h1" "$VIRTIO_NET_F_MAC" In basic_features.sh line 55: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In basic_features.sh line 59: virtio_feature_present $h1 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_feature_present "$h1" "$VIRTIO_NET_F_MAC" In basic_features.sh line 60: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In basic_features.sh line 68: grep -q 0 /sys/class/net/$h1/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h1"/addr_assign_type In basic_features.sh line 70: grep -q 0 /sys/class/net/$h2/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h2"/addr_assign_type In basic_features.sh line 74: virtio_filter_feature_add $h1 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_feature_add "$h1" "$VIRTIO_NET_F_MAC" In basic_features.sh line 75: virtio_filter_feature_add $h2 $VIRTIO_NET_F_MAC ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_feature_add "$h2" "$VIRTIO_NET_F_MAC" In basic_features.sh line 78: grep -q 0 /sys/class/net/$h1/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h1"/addr_assign_type In basic_features.sh line 80: grep -q 0 /sys/class/net/$h2/addr_assign_type ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q 0 /sys/class/net/"$h2"/addr_assign_type In basic_features.sh line 83: ping_do $h1 $H2_IPV4 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ping_do "$h1" "$H2_IPV4" In basic_features.sh line 89: buffer_circulation_test() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 91: RET=0 ^-^ SC2034 (warning): RET appears unused. Verify use (or export if used externally). In basic_features.sh line 98: ping -c 1 -I $h1 $H2_IPV4 >/dev/null ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ping -c 1 -I "$h1" "$H2_IPV4" >/dev/null In basic_features.sh line 99: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In basic_features.sh line 105: local rx_start=$(cat /sys/class/net/$h2/statistics/rx_packets) ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local rx_start=$(cat /sys/class/net/"$h2"/statistics/rx_packets) In basic_features.sh line 106: local tx_start=$(cat /sys/class/net/$h1/statistics/tx_packets) ^------^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local tx_start=$(cat /sys/class/net/"$h1"/statistics/tx_packets) In basic_features.sh line 113: iperf3 -s --bind-dev $h2 -p 5201 &>/dev/null & ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: iperf3 -s --bind-dev "$h2" -p 5201 &>/dev/null & In basic_features.sh line 117: if ! kill -0 $server_pid 2>/dev/null; then ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! kill -0 "$server_pid" 2>/dev/null; then In basic_features.sh line 126: iperf3 -c $H2_IPV4 --bind-dev $h1 -p 5201 -t 5 >/dev/null 2>&1 ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: iperf3 -c "$H2_IPV4" --bind-dev "$h1" -p 5201 -t 5 >/dev/null 2>&1 In basic_features.sh line 129: kill $server_pid 2>/dev/null || true ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill "$server_pid" 2>/dev/null || true In basic_features.sh line 130: wait $server_pid 2>/dev/null || true ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait "$server_pid" 2>/dev/null || true In basic_features.sh line 135: local hold=$(grep -c "page_pool_state_hold" "$trace" 2>/dev/null) ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values. In basic_features.sh line 136: local release=$(grep -c "page_pool_state_release" "$trace" 2>/dev/null) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In basic_features.sh line 140: local rx_end=$(cat /sys/class/net/$h2/statistics/rx_packets) ^----^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local rx_end=$(cat /sys/class/net/"$h2"/statistics/rx_packets) In basic_features.sh line 141: local tx_end=$(cat /sys/class/net/$h1/statistics/tx_packets) ^----^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local tx_end=$(cat /sys/class/net/"$h1"/statistics/tx_packets) In basic_features.sh line 147: if [ $iperf_ret -ne 0 ]; then ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$iperf_ret" -ne 0 ]; then In basic_features.sh line 158: virtio_device_rebind $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h1" In basic_features.sh line 159: virtio_device_rebind $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h2" In basic_features.sh line 160: wait_for_dev $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h1" In basic_features.sh line 161: wait_for_dev $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h2" In basic_features.sh line 169: setup_cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 176: virtio_filter_features_clear $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_features_clear "$h1" In basic_features.sh line 177: virtio_filter_features_clear $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_filter_features_clear "$h2" In basic_features.sh line 178: virtio_device_rebind $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h1" In basic_features.sh line 179: virtio_device_rebind $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: virtio_device_rebind "$h2" In basic_features.sh line 180: wait_for_dev $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h1" In basic_features.sh line 181: wait_for_dev $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: wait_for_dev "$h2" In basic_features.sh line 184: cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In basic_features.sh line 190: check_driver $h1 "virtio_net" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_driver "$h1" "virtio_net" In basic_features.sh line 191: check_driver $h2 "virtio_net" ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_driver "$h2" "virtio_net" In basic_features.sh line 192: check_virtio_debugfs $h1 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_virtio_debugfs "$h1" In basic_features.sh line 193: check_virtio_debugfs $h2 ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_virtio_debugfs "$h2" For more information: https://www.shellcheck.net/wiki/SC2034 -- ALL_TESTS appears unused. Verify ... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...