Skip to content

Commit ef1bd93

Browse files
matttbekuba-moo
authored andcommitted
selftests: mptcp: shellcheck: support v0.11.0
This v0.11.0 version introduces SC2329: Warn when (non-escaping) functions are never invoked. Except that, similar to SC2317, ShellCheck is currently unable to figure out functions that are invoked via trap, or indirectly, when calling functions via variables. It is then needed to disable this new SC2329. Reviewed-by: Geliang Tang <geliang@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250908-net-mptcp-misc-fixes-6-17-rc5-v1-3-5f2168a66079@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6f021e9 commit ef1bd93

7 files changed

Lines changed: 9 additions & 8 deletions

File tree

tools/testing/selftests/net/mptcp/diag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ flush_pids()
2828
}
2929

3030
# This function is used in the cleanup trap
31-
#shellcheck disable=SC2317
31+
#shellcheck disable=SC2317,SC2329
3232
cleanup()
3333
{
3434
ip netns pids "${ns}" | xargs --no-run-if-empty kill -SIGKILL &>/dev/null

tools/testing/selftests/net/mptcp/mptcp_connect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ ns4=""
134134
TEST_GROUP=""
135135

136136
# This function is used in the cleanup trap
137-
#shellcheck disable=SC2317
137+
#shellcheck disable=SC2317,SC2329
138138
cleanup()
139139
{
140140
rm -f "$cin_disconnect"

tools/testing/selftests/net/mptcp/mptcp_join.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# ShellCheck incorrectly believes that most of the code here is unreachable
1010
# because it's invoked by variable name, see how the "tests" array is used
11-
#shellcheck disable=SC2317
11+
#shellcheck disable=SC2317,SC2329
1212

1313
. "$(dirname "${0}")/mptcp_lib.sh"
1414

tools/testing/selftests/net/mptcp/mptcp_sockopt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ init()
9595
}
9696

9797
# This function is used in the cleanup trap
98-
#shellcheck disable=SC2317
98+
#shellcheck disable=SC2317,SC2329
9999
cleanup()
100100
{
101101
mptcp_lib_ns_exit "${ns1}" "${ns2}" "${ns_sbox}"

tools/testing/selftests/net/mptcp/pm_netlink.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ns1=""
3232
err=$(mktemp)
3333

3434
# This function is used in the cleanup trap
35-
#shellcheck disable=SC2317
35+
#shellcheck disable=SC2317,SC2329
3636
cleanup()
3737
{
3838
rm -f "${err}"
@@ -70,8 +70,9 @@ format_endpoints() {
7070
mptcp_lib_pm_nl_format_endpoints "${@}"
7171
}
7272

73+
# This function is invoked indirectly
74+
#shellcheck disable=SC2317,SC2329
7375
get_endpoint() {
74-
# shellcheck disable=SC2317 # invoked indirectly
7576
mptcp_lib_pm_nl_get_endpoint "${ns1}" "${@}"
7677
}
7778

tools/testing/selftests/net/mptcp/simult_flows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ usage() {
3535
}
3636

3737
# This function is used in the cleanup trap
38-
#shellcheck disable=SC2317
38+
#shellcheck disable=SC2317,SC2329
3939
cleanup()
4040
{
4141
rm -f "$cout" "$sout"

tools/testing/selftests/net/mptcp/userspace_pm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test_fail()
9494
}
9595

9696
# This function is used in the cleanup trap
97-
#shellcheck disable=SC2317
97+
#shellcheck disable=SC2317,SC2329
9898
cleanup()
9999
{
100100
print_title "Cleanup"

0 commit comments

Comments
 (0)