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.YxoB7AJDNd and /tmp/tmp.HDPEE3d2Yr Tree base: 88f1334d8ba7 ("selftests/vsock: prepare vm management helpers for namespaces") Now at: 216fbf1257e0 ("selftests/vsock: add vm_dmesg_{warn,oops}_count() helpers") ====== Checking before the patch ====== Checking tools/testing/selftests/vsock/vmtest.sh - 3bbe24ed85577bc751e7e913126d8b44bb8554cc21519ace46c3118b1749f848 In vmtest.sh line 13: 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 14: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 43: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 107: add_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 120: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 128: del_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 153: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 232: 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 238: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 242: 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 304: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 335: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 359: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 369: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 384: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 411: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 419: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 422: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 452: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 460: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 494: 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 498: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 510: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 522: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 597: host_oops_cnt_after=$(dmesg | grep -i 'Oops' | wc -l) ^------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. In vmtest.sh line 609: vm_oops_cnt_after=$(vm_ssh -- 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 13: 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 14: readonly KERNEL_CHECKOUT=$(realpath "${SCRIPT_DIR}"/../../../../) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 43: readonly LOG=$(mktemp /tmp/vsock_vmtest_XXXX.log) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In vmtest.sh line 107: add_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 120: init_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 128: del_namespaces() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 153: cleanup() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 232: 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 238: if ! make -j$(nproc); then ^------^ SC2046 (warning): Quote this to prevent word splitting. In vmtest.sh line 242: 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 304: ${kernel_opt} \ ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kernel_opt}" \ In vmtest.sh line 335: wait_for_listener() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 359: vm_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 369: host_wait_for_listener() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 395: vm_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 422: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 430: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 433: host_vsock_test() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 463: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 471: return $rc ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: return "$rc" In vmtest.sh line 505: 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 509: test_vm_server_host_client() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 521: test_vm_client_host_server() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 533: test_vm_loopback() { ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). In vmtest.sh line 608: 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 ...