[PATCH 6/6] torture: Use ${:+} to save a few lines in torture.sh's torture_one()
From: Paul E. McKenney
Date: Mon Nov 16 2026 - 12:26:49 EST
This commit uses the ${:+} bash substitution pattern in the torture_one()
function in torture.sh to save a few lines of code.
Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
---
tools/testing/selftests/rcutorture/bin/torture.sh | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/tools/testing/selftests/rcutorture/bin/torture.sh b/tools/testing/selftests/rcutorture/bin/torture.sh
index bc842c94c4379..0498fce14ccd6 100755
--- a/tools/testing/selftests/rcutorture/bin/torture.sh
+++ b/tools/testing/selftests/rcutorture/bin/torture.sh
@@ -354,16 +354,8 @@ touch $T/successes
# Note that quoting is problematic. So on the command line, pass multiple
# values with multiple kvm.sh argument instances.
function torture_one {
- local cur_bootargs=
- local boottag=
-
echo " --- $curflavor:" Start `date` | tee -a $T/log
- if test -n "$torture_bootargs"
- then
- boottag="--bootargs"
- cur_bootargs="$torture_bootargs"
- fi
- "$@" $boottag "$cur_bootargs" --datestamp "$ds/results-$curflavor" > $T/$curflavor.out 2>&1
+ "$@" ${torture_bootargs:+--bootargs "$torture_bootargs"} --datestamp "$ds/results-$curflavor" > $T/$curflavor.out 2>&1
retcode=$?
resdir="`grep '^Results directory: ' $T/$curflavor.out | tail -1 | sed -e 's/^Results directory: //'`"
if test -z "$resdir"
--
2.40.1