ShellCheck - shell script analysis tool version: 0.10.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.4ZYQlEZYF3 and /tmp/tmp.XMieA0sxu4 Tree base: 5d6d67c4cb10 ("Merge branch 'net-bcmgenet-add-support-for-gro-software-interrupt-coalescing'") Now at: 0310db65320f ("selftest: Add selftest for multicast address notifications") ====== Checking before the patch ====== ====== Checking the tree with the patch ====== Checking tools/testing/selftests/net/rtnetlink_notification.sh - fa38ef9ee877f2b33c6522490a94c39c324964eee636cc12705bd0d305deff99 In rtnetlink_notification.sh line 29: local cmd="$*" ^------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 30: local out ^-------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 31: if [ "$VERBOSE" = "1" ]; then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 32: echo "COMMAND: ${cmd}" ^--------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 34: out=$($cmd 2>&1) ^--------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 35: rc=$? ^---^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 36: if [ "$VERBOSE" = "1" -a -n "$out" ]; then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-- SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. In rtnetlink_notification.sh line 37: echo " $out" ^-------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 39: return $rc ^--------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In rtnetlink_notification.sh line 43: run_cmd_common "$@" ^-----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 44: rc=$? ^---^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 45: check_err $rc ^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: check_err "$rc" In rtnetlink_notification.sh line 46: return $rc ^--------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In rtnetlink_notification.sh line 56: read a ^--^ SC2162 (info): read without -r will mangle backslashes. In rtnetlink_notification.sh line 61: read a ^--^ SC2162 (info): read without -r will mangle backslashes. In rtnetlink_notification.sh line 68: local tmpfile ^-----------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 69: local monitor_pid ^---------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 70: local match_result ^----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 72: tmpfile=$(mktemp) ^---------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 74: ip monitor maddr > $tmpfile & ^--------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ip monitor maddr > "$tmpfile" & In rtnetlink_notification.sh line 75: monitor_pid=$! ^------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 76: sleep 1 ^-----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 77: if [ ! -e "/proc/$monitor_pid" ]; then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^---------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 78: end_test "SKIP: mcast addr notification: iproute2 too old" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 79: rm $tmpfile ^---------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm "$tmpfile" In rtnetlink_notification.sh line 80: return $ksft_skip ^---------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$ksft_skip" In rtnetlink_notification.sh line 83: run_cmd ip link add name test-dummy1 type dummy ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 84: run_cmd ip link set test-dummy1 up ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 85: run_cmd ip link del dev test-dummy1 ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 86: sleep 1 ^-----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 88: match_result=$(grep -cE "test-dummy1.*(224.0.0.1|ff02::1)" $tmpfile) ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: match_result=$(grep -cE "test-dummy1.*(224.0.0.1|ff02::1)" "$tmpfile") In rtnetlink_notification.sh line 90: kill $monitor_pid ^---------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: kill "$monitor_pid" In rtnetlink_notification.sh line 91: rm $tmpfile ^---------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm "$tmpfile" In rtnetlink_notification.sh line 97: if [ $match_result -ne 4 ];then ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^---------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$match_result" -ne 4 ];then In rtnetlink_notification.sh line 98: end_test "FAIL: mcast addr notification" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 99: return 1 ^------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 101: end_test "PASS: mcast addr notification" ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In rtnetlink_notification.sh line 123: (options: $(echo $ALL_TESTS)) ^----------------^ SC2116 (style): Useless echo? Instead of 'cmd $(echo foo)', just use 'cmd foo'. ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: (options: $(echo "$ALL_TESTS")) In rtnetlink_notification.sh line 136: for x in ip;do ^-- SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion? In rtnetlink_notification.sh line 138: if [ $? -ne 0 ];then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. For more information: https://www.shellcheck.net/wiki/SC2043 -- This loop will only ever run once... https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...