]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rcutorture: Fix numeric "test" comparison in srcu_lockdep.sh
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 28 Jan 2026 20:42:24 +0000 (12:42 -0800)
committerJoel Fernandes <joelagnelf@nvidia.com>
Mon, 30 Mar 2026 19:48:13 +0000 (15:48 -0400)
This commit switches from "-eq" to "=" to handle the non-numeric
comparisons in srcu_lockdep.sh.  While in the area, adjust SRCU flavor
to improve coverage.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
tools/testing/selftests/rcutorture/bin/srcu_lockdep.sh

index 208be7d09a612ac15b5d20a145083afbd5c9971d..4e98c697def487c318ed3db757c8fdd44986b40d 100755 (executable)
@@ -50,7 +50,7 @@ do
                do
                        err=
                        val=$((d*1000+t*10+c))
-                       tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 5s --configs "SRCU-P" --kconfig "CONFIG_FORCE_NEED_SRCU_NMI_SAFE=y" --bootargs "rcutorture.test_srcu_lockdep=$val rcutorture.reader_flavor=0x2" --trust-make --datestamp "$ds/$val" > "$T/kvm.sh.out" 2>&1
+                       tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 5s --configs "SRCU-P" --kconfig "CONFIG_FORCE_NEED_SRCU_NMI_SAFE=y" --bootargs "rcutorture.test_srcu_lockdep=$val rcutorture.reader_flavor=0x4" --trust-make --datestamp "$ds/$val" > "$T/kvm.sh.out" 2>&1
                        ret=$?
                        mv "$T/kvm.sh.out" "$RCUTORTURE/res/$ds/$val"
                        if ! grep -q '^CONFIG_PROVE_LOCKING=y' .config
@@ -92,12 +92,12 @@ do
                nerrs=$((nerrs+1))
                err=1
        fi
-       if test "$val" -eq 0xf && test "$ret" -eq 0
+       if test "$val" = 0xf && test "$ret" -eq 0
        then
                err=1
                echo -n Unexpected success for > "$RCUTORTURE/res/$ds/$val/kvm.sh.err"
        fi
-       if test "$val" -eq 0x1 && test "$ret" -ne 0
+       if test "$val" = 0x1 && test "$ret" -ne 0
        then
                err=1
                echo -n Unexpected failure for > "$RCUTORTURE/res/$ds/$val/kvm.sh.err"