]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tools/memory-model: Remove redundant initialization in litmus tests
authorAkira Yokosawa <akiyks@gmail.com>
Fri, 27 Nov 2020 23:43:45 +0000 (08:43 +0900)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 4 Jan 2021 22:40:49 +0000 (14:40 -0800)
This is a revert of commit 1947bfcf81a9 ("tools/memory-model: Add types
to litmus tests") with conflict resolutions.

klitmus7 [1] is aware of default types of "int" and "int*".
It accepts litmus tests for herd7 without extra type info unless
non-"int" variables are referenced by an "exists", "locations",
or "filter" directive.

[1]: Tested with klitmus7 versions 7.49 or later.

Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
32 files changed:
tools/memory-model/litmus-tests/CoRR+poonceonce+Once.litmus
tools/memory-model/litmus-tests/CoRW+poonceonce+Once.litmus
tools/memory-model/litmus-tests/CoWR+poonceonce+Once.litmus
tools/memory-model/litmus-tests/CoWW+poonceonce.litmus
tools/memory-model/litmus-tests/IRIW+fencembonceonces+OnceOnce.litmus
tools/memory-model/litmus-tests/IRIW+poonceonces+OnceOnce.litmus
tools/memory-model/litmus-tests/ISA2+pooncelock+pooncelock+pombonce.litmus
tools/memory-model/litmus-tests/ISA2+poonceonces.litmus
tools/memory-model/litmus-tests/ISA2+pooncerelease+poacquirerelease+poacquireonce.litmus
tools/memory-model/litmus-tests/LB+fencembonceonce+ctrlonceonce.litmus
tools/memory-model/litmus-tests/LB+poacquireonce+pooncerelease.litmus
tools/memory-model/litmus-tests/LB+poonceonces.litmus
tools/memory-model/litmus-tests/MP+fencewmbonceonce+fencermbonceonce.litmus
tools/memory-model/litmus-tests/MP+onceassign+derefonce.litmus
tools/memory-model/litmus-tests/MP+polockmbonce+poacquiresilsil.litmus
tools/memory-model/litmus-tests/MP+polockonce+poacquiresilsil.litmus
tools/memory-model/litmus-tests/MP+polocks.litmus
tools/memory-model/litmus-tests/MP+poonceonces.litmus
tools/memory-model/litmus-tests/MP+pooncerelease+poacquireonce.litmus
tools/memory-model/litmus-tests/MP+porevlocks.litmus
tools/memory-model/litmus-tests/R+fencembonceonces.litmus
tools/memory-model/litmus-tests/R+poonceonces.litmus
tools/memory-model/litmus-tests/S+fencewmbonceonce+poacquireonce.litmus
tools/memory-model/litmus-tests/S+poonceonces.litmus
tools/memory-model/litmus-tests/SB+fencembonceonces.litmus
tools/memory-model/litmus-tests/SB+poonceonces.litmus
tools/memory-model/litmus-tests/SB+rfionceonce-poonceonces.litmus
tools/memory-model/litmus-tests/WRC+poonceonces+Once.litmus
tools/memory-model/litmus-tests/WRC+pooncerelease+fencermbonceonce+Once.litmus
tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus
tools/memory-model/litmus-tests/Z6.0+pooncelock+pooncelock+pombonce.litmus
tools/memory-model/litmus-tests/Z6.0+pooncerelease+poacquirerelease+fencembonceonce.litmus

index 772544f03fb5f0ff459cfaf773bba5e1181edcaf..967f9f2a6226ba62ed593e6aff9e99d1fae02c85 100644 (file)
@@ -7,9 +7,7 @@ C CoRR+poonceonce+Once
  * reads from the same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 5faae98f7ffb3f9890e8f6674967ea6ef3ea53e1..4635739f3974dd76925b2a20f874f03a2e55ce5f 100644 (file)
@@ -7,9 +7,7 @@ C CoRW+poonceonce+Once
  * a given variable and a later write to that same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 77c9cc9f8dc663652eaa0465e0d8e28ac3cff333..bb068c92d8da27fad692b9d168875bc9c5de815c 100644 (file)
@@ -7,9 +7,7 @@ C CoWR+poonceonce+Once
  * given variable and a later read from that same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 85ef746f511a7aad10b9844587e543e15a63aee3..0d9f0a9587996cd37950a7fd4e12eed1e7a7faf9 100644 (file)
@@ -7,9 +7,7 @@ C CoWW+poonceonce
  * writes to the same variable are ordered.
  *)
 
-{
-       int x;
-}
+{}
 
 P0(int *x)
 {
index 87aa900125ab232d14eefe6cb00568dece5e4621..e729d2776e89a7854bc8d2dfc8a856213e4b6a35 100644 (file)
@@ -10,10 +10,7 @@ C IRIW+fencembonceonces+OnceOnce
  * process?  This litmus test exercises LKMM's "propagation" rule.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index f84022dca5551e111c045da83668e65d3795e88e..4b54dd6a6cd9464ace77b470fc38f4ef86ce5cef 100644 (file)
@@ -10,10 +10,7 @@ C IRIW+poonceonces+OnceOnce
  * different process?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index 398f624daa7717e1f521d109646643840867a023..094d58df778969c836e97b945e92d3329e1c509f 100644 (file)
@@ -7,12 +7,7 @@ C ISA2+pooncelock+pooncelock+pombonce
  * (in P0() and P1()) is visible to external process P2().
  *)
 
-{
-       spinlock_t mylock;
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 212a432ba16ba5341fdf1420ed2938bed0c44e18..b321aa6f4ea52d4125b750cd6517d1feddb522d0 100644 (file)
@@ -9,11 +9,7 @@ C ISA2+poonceonces
  * of the smp_load_acquire() invocations are replaced by READ_ONCE()?
  *)
 
-{
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y)
 {
index 7afd85672ccdeaedeb99903a24ed0a284a5ebff8..025b0462ec9bcdb56c35150ab52716aea1b1589c 100644 (file)
@@ -11,11 +11,7 @@ C ISA2+pooncerelease+poacquirerelease+poacquireonce
  * (AKA non-rf) link, so release-acquire is all that is needed.
  *)
 
-{
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y)
 {
index c8a93c7ee556a11ffbfcecdf0890745b1b03d459..4727f5aaf03b05b1c98a6d2d53ded40c8d7023e4 100644 (file)
@@ -11,10 +11,7 @@ C LB+fencembonceonce+ctrlonceonce
  * another control dependency and order would still be maintained.)
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 2fa029568fa1ca9c2d2489ff248a33b57b8bb202..07b9904b0e49f058f8b0f7505078ffb213aa5a6c 100644 (file)
@@ -8,10 +8,7 @@ C LB+poacquireonce+pooncerelease
  * to the other?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 2107306e8625b9acbbeb9a07c6e57e535b3314c0..74c49cb3c37bf78df023689161b09678f78ce2a1 100644 (file)
@@ -7,10 +7,7 @@ C LB+poonceonces
  * be prevented even with no explicit ordering?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index c5c168d929737b68bcae760c12838775cb22a04c..f8ca1229857ad5cabb24b0f31760f17acfc73a39 100644 (file)
@@ -8,10 +8,7 @@ C MP+fencewmbonceonce+fencermbonceonce
  * is usually better to use smp_store_release() and smp_load_acquire().
  *)
 
-{
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag) // Producer
 {
index 20ff62649f1ee2e51a7ffa2eb5118d8cad1846d8..d84160b9c1ae01f391b869c8c5b727bbd535f660 100644 (file)
@@ -10,9 +10,7 @@ C MP+onceassign+derefonce
  *)
 
 {
-       int *p=y;
-       int x;
-       int y=0;
+p=y;
 }
 
 P0(int *x, int **p) // Producer
index 153917ad5dc950f84248bf25cee8e493d7dd9fa5..ba91cc63e1487e2dced1cc95997bda5735beaa8c 100644 (file)
@@ -10,10 +10,7 @@ C MP+polockmbonce+poacquiresilsil
  * executed before the lock was acquired (loosely speaking).
  *)
 
-{
-       spinlock_t lo;
-       int x;
-}
+{}
 
 P0(spinlock_t *lo, int *x) // Producer
 {
index aad64397bb8cd4c0e9daa7f429676c9c704b09da..a5ea3ed8f52ebdd7a897032be5ae75ded4a1b3f2 100644 (file)
@@ -10,10 +10,7 @@ C MP+polockonce+poacquiresilsil
  * speaking).
  *)
 
-{
-       spinlock_t lo;
-       int x;
-}
+{}
 
 P0(spinlock_t *lo, int *x) // Producer
 {
index 21cbca6f3be4ca8a385eac87900b379c7ffae09b..e6af05f70069f87df47fedf8a2ebd250e1f86ec1 100644 (file)
@@ -11,11 +11,7 @@ C MP+polocks
  * to see all prior accesses by those other CPUs.
  *)
 
-{
-       spinlock_t mylock;
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag, spinlock_t *mylock) // Producer
 {
index 9f9769d647c7bb787e5ce9339ec8414541f53067..ba9c99c6cf65dae90724503c1996935ce9e1f809 100644 (file)
@@ -7,10 +7,7 @@ C MP+poonceonces
  * no ordering at all?
  *)
 
-{
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag) // Producer
 {
index cbe28e7334437866a1b250c01999952453b296c1..f174bfe61702c98c73f239475639de40aeaf16ce 100644 (file)
@@ -8,10 +8,7 @@ C MP+pooncerelease+poacquireonce
  * pattern.
  *)
 
-{
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag) // Producer
 {
index 012041bd4feb30574d459e583a4e3f31ea1a1c51..b9599141160e62742cc10b99f35801be7b6a70f1 100644 (file)
@@ -11,11 +11,7 @@ C MP+porevlocks
  * see all prior accesses by those other CPUs.
  *)
 
-{
-       spinlock_t mylock;
-       int buf;
-       int flag;
-}
+{}
 
 P0(int *buf, int *flag, spinlock_t *mylock) // Consumer
 {
index af9463b39b4a5daacd517d7e552f49ac963f1206..222a0b850b4a5d98d087c2d94ab5158e928c43ae 100644 (file)
@@ -9,10 +9,7 @@ C R+fencembonceonces
  * cause the resulting test to be allowed.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index bcd5574e304ae762c0a32064e215b6a3d200fd38..5386f128a131dfa50852e6fc5869700d0fe09d17 100644 (file)
@@ -8,10 +8,7 @@ C R+poonceonces
  * store propagation delays.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index c36341d1aed66d2e53df3197526726be1e5ed40b..18479823cd6ccd1315b6723a215bf8df7f38daf2 100644 (file)
@@ -7,10 +7,7 @@ C S+fencewmbonceonce+poacquireonce
  * store against a subsequent store?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 7775c23143a0caa635cff6873ae5edd04ae8c174..8c9c2f81a58055cdba5eeea5c502ef24d9416a69 100644 (file)
@@ -9,10 +9,7 @@ C S+poonceonces
  * READ_ONCE(), is ordering preserved?
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 833cdfeb7c093ce9ebb2a616b4e7567d6ee72c79..ed5fff18d2232b722ab4aab2d8bc8403a6fb908b 100644 (file)
@@ -9,10 +9,7 @@ C SB+fencembonceonces
  * suffice, but not much else.)
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index c92211ecbfdf70b6b820585b4e59f78f7d106637..10d550730b25fdd800f2dd5ec8a9f0e555d65415 100644 (file)
@@ -8,10 +8,7 @@ C SB+poonceonces
  * variable that the preceding process reads.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 84344b455eb7144ba9378cf5eeba68e2bd0ae399..04a16603660bd29716912acb18d03e894f3a73f3 100644 (file)
@@ -6,10 +6,7 @@ C SB+rfionceonce-poonceonces
  * This litmus test demonstrates that LKMM is not fully multicopy atomic.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x, int *y)
 {
index 431494708611bfe41cfd744d2b132516e30e536e..6a2bc12a1af1ad6b6bf75c5a902e01acd54f3af7 100644 (file)
@@ -8,10 +8,7 @@ C WRC+poonceonces+Once
  * test has no ordering at all.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index 554999c64db587ba7b5d1b8dd018ef5fc91c7dbc..e9947250d7de6a06ca67a33e9214284fe421a723 100644 (file)
@@ -10,10 +10,7 @@ C WRC+pooncerelease+fencermbonceonce+Once
  * is A-cumulative in LKMM.
  *)
 
-{
-       int x;
-       int y;
-}
+{}
 
 P0(int *x)
 {
index 265a95ffef1373bfe605230a718828bf75063f86..415248fb669902a9b1c77e0abf905fabfc9634f5 100644 (file)
@@ -9,12 +9,7 @@ C Z6.0+pooncelock+poonceLock+pombonce
  * by CPUs not holding that lock.
  *)
 
-{
-       spinlock_t mylock;
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 0c9aea8e80df08425721ef252f5f4b3884ba97f6..10a2aa04cd078d9b55898887bb4373437b7b9288 100644 (file)
@@ -8,12 +8,7 @@ C Z6.0+pooncelock+pooncelock+pombonce
  * seen as ordered by a third process not holding that lock.
  *)
 
-{
-       spinlock_t mylock;
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y, spinlock_t *mylock)
 {
index 661f9aaa57914b76ca2759d3deeeb8937c96eaec..88e70b87a683e045ddf3148b7a6a9808214cc5c0 100644 (file)
@@ -14,11 +14,7 @@ C Z6.0+pooncerelease+poacquirerelease+fencembonceonce
  * involving locking.)
  *)
 
-{
-       int x;
-       int y;
-       int z;
-}
+{}
 
 P0(int *x, int *y)
 {