mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
selftests: mptcp: userspace_pm: fix shellcheck warnings
shellcheck recently helped to find an issue where a wrong variable name was used. It is then good to fix the other harmless issues in order to spot "real" ones later. Here, three categories of warnings are ignored: - SC2317: Command appears to be unreachable. The cleanup() function is invoke indirectly via the EXIT trap. - SC2034: Variable appears unused. The check_expected_one() function takes the name of the variable in argument but it ends up reading the content: indirect usage. - SC2086: Double quote to prevent globbing and word splitting. This is recommended but the current usage is correct and there is no need to do all these modifications to be compliant with this rule. One error has been fixed with SC2181: Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e141c1e8e4
commit
8320b1387a
1 changed files with 10 additions and 2 deletions
|
@ -1,6 +1,13 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
# Double quotes to prevent globbing and word splitting is recommended in new
|
||||
# code but we accept it.
|
||||
#shellcheck disable=SC2086
|
||||
|
||||
# Some variables are used below but indirectly, see check_expected_one()
|
||||
#shellcheck disable=SC2034
|
||||
|
||||
. "$(dirname "${0}")/mptcp_lib.sh"
|
||||
|
||||
mptcp_lib_check_mptcp
|
||||
|
@ -11,8 +18,7 @@ if ! mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
|
|||
exit ${KSFT_SKIP}
|
||||
fi
|
||||
|
||||
ip -Version > /dev/null 2>&1
|
||||
if [ $? -ne 0 ];then
|
||||
if ! ip -Version &> /dev/null; then
|
||||
echo "SKIP: Cannot not run test without ip tool"
|
||||
exit ${KSFT_SKIP}
|
||||
fi
|
||||
|
@ -68,6 +74,8 @@ kill_wait()
|
|||
wait $1 2>/dev/null
|
||||
}
|
||||
|
||||
# This function is used in the cleanup trap
|
||||
#shellcheck disable=SC2317
|
||||
cleanup()
|
||||
{
|
||||
print_title "Cleanup"
|
||||
|
|
Loading…
Reference in a new issue