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.8N38Vz5sCV and /tmp/tmp.lEI4CHrVJk Tree base: fa78bca20d0b ("selftests: net: update some helpers to use run_on") Now at: 70b5860b9b93 ("selftests: drivers: hw: cleanup shellcheck warnings in the rmon test") ====== Checking before the patch ====== Checking tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh - fdb736f75434bd46b1f19ffc1d8f67cbd0ecc9c6db4cf3279ea5ff6906693cbb In ethtool_rmon.sh line 4: ALL_TESTS=" ^-------^ SC2034 (warning): ALL_TESTS appears unused. Verify use (or export if used externally). In ethtool_rmon.sh line 18: ensure_mtu() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In ethtool_rmon.sh line 22: local current=$(ip -j link show dev $iface | jq -r '.[0].mtu') ^-----^ 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 current=$(ip -j link show dev "$iface" | jq -r '.[0].mtu') In ethtool_rmon.sh line 25: if [ $current -lt $required ]; then ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$current" -lt "$required" ]; then In ethtool_rmon.sh line 26: ip link set dev $iface mtu $required || return 1 ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set dev "$iface" mtu "$required" || return 1 In ethtool_rmon.sh line 30: bucket_test() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In ethtool_rmon.sh line 49: before=$(ethtool --json -S $iface --groups rmon | \ ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: before=$(ethtool --json -S "$iface" --groups rmon | \ In ethtool_rmon.sh line 54: $MZ $neigh -q -c $num_rx -p $len -a own -b bcast -d 10us ^----^ 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: $MZ "$neigh" -q -c "$num_rx" -p "$len" -a own -b bcast -d 10us In ethtool_rmon.sh line 55: $MZ $iface -q -c $num_tx -p $len -a own -b bcast -d 10us ^----^ 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: $MZ "$iface" -q -c "$num_tx" -p "$len" -a own -b bcast -d 10us In ethtool_rmon.sh line 57: after=$(ethtool --json -S $iface --groups rmon | \ ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: after=$(ethtool --json -S "$iface" --groups rmon | \ In ethtool_rmon.sh line 62: expected=$([ $set = rx ] && echo $num_rx || echo $num_tx) ^--^ 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: expected=$([ "$set" = rx ] && echo "$num_rx" || echo "$num_tx") In ethtool_rmon.sh line 65: [ $delta -ge $expected ] && [ $delta -le $((expected + 100)) ] ^----^ 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: [ "$delta" -ge "$expected" ] && [ "$delta" -le $((expected + 100)) ] In ethtool_rmon.sh line 68: rmon_histogram() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In ethtool_rmon.sh line 76: RET=0 ^-^ SC2034 (warning): RET appears unused. Verify use (or export if used externally). In ethtool_rmon.sh line 82: if ! ensure_mtu $if ${bucket[0]}; then ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! ensure_mtu "$if" "${bucket[0]}"; then In ethtool_rmon.sh line 88: if ! bucket_test $iface $neigh $set $nbuckets ${bucket[0]}; then ^----^ 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. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if ! bucket_test "$iface" "$neigh" "$set" "$nbuckets" "${bucket[0]}"; then In ethtool_rmon.sh line 94: done < <(ethtool --json -S $iface --groups rmon | \ ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: done < <(ethtool --json -S "$iface" --groups rmon | \ In ethtool_rmon.sh line 97: if [ $nbuckets -eq 0 ]; then ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$nbuckets" -eq 0 ]; then In ethtool_rmon.sh line 103: rmon_rx_histogram() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In ethtool_rmon.sh line 105: rmon_histogram $h1 $h2 rx ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rmon_histogram "$h1" "$h2" rx In ethtool_rmon.sh line 106: rmon_histogram $h2 $h1 rx ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rmon_histogram "$h2" "$h1" rx In ethtool_rmon.sh line 109: rmon_tx_histogram() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In ethtool_rmon.sh line 111: rmon_histogram $h1 $h2 tx ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rmon_histogram "$h1" "$h2" tx In ethtool_rmon.sh line 112: rmon_histogram $h2 $h1 tx ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rmon_histogram "$h2" "$h1" tx In ethtool_rmon.sh line 121: netif_mtu[$iface]=$(ip -j link show dev $iface | jq -r '.[0].mtu') ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: netif_mtu[$iface]=$(ip -j link show dev "$iface" | jq -r '.[0].mtu') In ethtool_rmon.sh line 122: ip link set dev $iface up ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set dev "$iface" up In ethtool_rmon.sh line 126: cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In ethtool_rmon.sh line 131: ip link set dev $iface \ ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip link set dev "$iface" \ In ethtool_rmon.sh line 132: mtu ${netif_mtu[$iface]} \ ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mtu "${netif_mtu[$iface]}" \ In ethtool_rmon.sh line 145: exit $EXIT_STATUS ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: exit "$EXIT_STATUS" 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 ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh - fdb736f75434bd46b1f19ffc1d8f67cbd0ecc9c6db4cf3279ea5ff6906693cbb tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh is shellcheck compliant