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.kv2yab4r84 and /tmp/tmp.NBf4otJlNW Tree base: 5446b8691eb8 ("Merge branch 'dpaa2-fix-config-relation-with-fsl_dpaa2_switch'") Now at: deea08ebae29 ("selftests/vsock: auto-detect kernel for guest VMs") ====== Checking before the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 14: readonly SCRIPT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" ^--------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 15: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 44: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 230: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 265: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 372: pushd "${KERNEL_CHECKOUT}" &>/dev/null ^-- SC2164 (warning): Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails. Did you mean: pushd "${KERNEL_CHECKOUT}" &>/dev/null || exit In vmtest.sh line 378: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 382: popd &>/dev/null ^--------------^ SC2164 (warning): Use 'popd ... || exit' or 'popd ... || return' in case popd fails. Did you mean: popd &>/dev/null || exit In vmtest.sh line 410: terminate_pids() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 452: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 483: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 518: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 529: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 556: vm_dmesg_check() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 578: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 605: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 613: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 616: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 650: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 658: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 692: log_guest() { ^-- SC2120 (warning): log_guest references arguments, but none are ever passed. ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 696: ns_get_mode() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 702: test_ns_host_vsock_ns_mode_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 716: test_ns_diff_global_host_connect_to_global_vm_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 769: test_ns_diff_global_host_connect_to_local_vm_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 812: test_ns_diff_global_vm_connect_to_global_host_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 875: test_ns_diff_global_vm_connect_to_local_host_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 926: test_ns_diff_local_host_connect_to_local_vm_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 971: test_ns_diff_local_vm_connect_to_local_host_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1019: __test_loopback_two_netns() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1049: test_ns_diff_global_to_local_loopback_local_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1059: test_ns_diff_local_to_global_loopback_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1069: test_ns_diff_local_to_local_loopback_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1079: test_ns_diff_global_to_global_loopback_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1089: test_ns_same_local_loopback_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1099: test_ns_same_local_host_connect_to_local_vm_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1142: test_ns_same_local_vm_connect_to_local_host_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1178: namespaces_can_boot_same_cid() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1200: test_ns_global_same_cid_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1210: test_ns_local_global_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1220: test_ns_global_local_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1230: test_ns_local_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1240: test_ns_host_vsock_child_ns_mode_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1262: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1274: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1286: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1303: check_ns_delete_doesnt_break_connection() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1363: test_ns_delete_vm_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1367: test_ns_delete_host_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1371: test_ns_delete_both_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1438: host_oops_cnt_after=$(dmesg | grep -i 'Oops' | wc -l) ^------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2120 -- log_guest references arguments, b... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... ====== Checking the tree with the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 14: readonly SCRIPT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" ^--------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 15: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 44: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 230: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 265: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 372: pushd "${KERNEL_CHECKOUT}" &>/dev/null ^-- SC2164 (warning): Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails. Did you mean: pushd "${KERNEL_CHECKOUT}" &>/dev/null || exit In vmtest.sh line 378: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 382: popd &>/dev/null ^--------------^ SC2164 (warning): Use 'popd ... || exit' or 'popd ... || return' in case popd fails. Did you mean: popd &>/dev/null || exit In vmtest.sh line 410: terminate_pids() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 471: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 502: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 537: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 548: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 575: vm_dmesg_check() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 597: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 624: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 632: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 635: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 669: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 677: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 711: log_guest() { ^-- SC2120 (warning): log_guest references arguments, but none are ever passed. ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 715: ns_get_mode() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 721: test_ns_host_vsock_ns_mode_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 735: test_ns_diff_global_host_connect_to_global_vm_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 788: test_ns_diff_global_host_connect_to_local_vm_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 831: test_ns_diff_global_vm_connect_to_global_host_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 894: test_ns_diff_global_vm_connect_to_local_host_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 945: test_ns_diff_local_host_connect_to_local_vm_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 990: test_ns_diff_local_vm_connect_to_local_host_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1038: __test_loopback_two_netns() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1068: test_ns_diff_global_to_local_loopback_local_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1078: test_ns_diff_local_to_global_loopback_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1088: test_ns_diff_local_to_local_loopback_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1098: test_ns_diff_global_to_global_loopback_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1108: test_ns_same_local_loopback_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1118: test_ns_same_local_host_connect_to_local_vm_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1161: test_ns_same_local_vm_connect_to_local_host_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1197: namespaces_can_boot_same_cid() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1219: test_ns_global_same_cid_fails() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1229: test_ns_local_global_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1239: test_ns_global_local_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1249: test_ns_local_same_cid_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1259: test_ns_host_vsock_child_ns_mode_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1281: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1293: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1305: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1322: check_ns_delete_doesnt_break_connection() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1382: test_ns_delete_vm_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1386: test_ns_delete_host_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1390: test_ns_delete_both_ok() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 1457: host_oops_cnt_after=$(dmesg | grep -i 'Oops' | wc -l) ^------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2120 -- log_guest references arguments, b... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...