diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2024-04-08 22:41:22 +0200 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2024-05-06 23:29:21 +0200 |
commit | 2ba5b4130e3d5d05c95981e1d2e660d57e613fda (patch) | |
tree | 9c64fc5b63d59195a218e2a57805333cb3342706 /Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus | |
parent | Documentation/atomic_t: Emphasize that failed atomic operations give no ordering (diff) | |
download | linux-2ba5b4130e3d5d05c95981e1d2e660d57e613fda.tar.xz linux-2ba5b4130e3d5d05c95981e1d2e660d57e613fda.zip |
Documentation/litmus-tests: Make cmpxchg() tests safe for klitmus
The four litmus tests in Documentation/litmus-tests/atomic do not
declare all of their local variables. Although this is just fine for LKMM
analysis by herd7, it causes build failures when run in-kernel by klitmus.
This commit therefore adjusts these tests to declare all local variables.
Reported-by: Andrea Parri <parri.andrea@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Andrea Parri <parri.andrea@gmail.com>
Diffstat (limited to 'Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus')
-rw-r--r-- | Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus b/Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus index 3df1d140b189..c0f93dc07105 100644 --- a/Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus +++ b/Documentation/litmus-tests/atomic/cmpxchg-fail-ordered-1.litmus @@ -23,6 +23,7 @@ P0(int *x, int *y, int *z) P1(int *x, int *y, int *z) { int r0; + int r1; WRITE_ONCE(*y, 1); r1 = cmpxchg(z, 1, 0); |