From: Petr Machata Date: Thu, 27 Jun 2024 14:48:40 +0000 (+0200) Subject: selftests: lib: tc_rule_stats_get(): Move default to argument definition X-Git-Tag: io_uring-6.11-20240722~71^2~122^2~9 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9b5d5f272654ca4b97f39b6ef809e4edef794fdc;p=linux-block.git selftests: lib: tc_rule_stats_get(): Move default to argument definition The argument $dir has a fallback value of "ingress". Move the fallback from the usage site to the argument definition block to make the fact clearer. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh index 915f319bcc8b..d0219032f773 100644 --- a/tools/testing/selftests/net/lib.sh +++ b/tools/testing/selftests/net/lib.sh @@ -199,10 +199,10 @@ tc_rule_stats_get() { local dev=$1; shift local pref=$1; shift - local dir=$1; shift + local dir=${1:-ingress}; shift local selector=${1:-.packets}; shift - tc -j -s filter show dev $dev ${dir:-ingress} pref $pref \ + tc -j -s filter show dev $dev $dir pref $pref \ | jq ".[1].options.actions[].stats$selector" }