summaryrefslogtreecommitdiff
path: root/Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2024-04-08 23:41:22 +0300
committerPaul E. McKenney <paulmck@kernel.org>2024-05-07 00:29:21 +0300
commit2ba5b4130e3d5d05c95981e1d2e660d57e613fda (patch)
tree9c64fc5b63d59195a218e2a57805333cb3342706 /Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus
parentd372e20433cbc0b0e3e59c89ccb6618501fcf6af (diff)
downloadlinux-2ba5b4130e3d5d05c95981e1d2e660d57e613fda.tar.xz
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-unordered-2.litmus')
-rw-r--r--Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus b/Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus
index a245bac55b57..61aab24a4a64 100644
--- a/Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus
+++ b/Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-2.litmus
@@ -12,7 +12,6 @@ C cmpxchg-fail-unordered-2
P0(int *x, int *y)
{
- int r0;
int r1;
WRITE_ONCE(*x, 1);
@@ -21,7 +20,8 @@ P0(int *x, int *y)
P1(int *x, int *y)
{
- int r0;
+ int r1;
+ int r2;
r1 = cmpxchg(y, 0, 1);
r2 = READ_ONCE(*x);