Skip to content

Commit 4bbb6df

Browse files
surenbaghdasaryanakpm00
authored andcommitted
tools: fix atomic_set() definition to set the value correctly
Currently vma test is failing because of the new vma_assert_attached() assertion. The check is failing because previous refcount_set() inside vma_mark_attached() is a NoOp. Fix the definition of atomic_set() to correctly set the value of the atomic. Link: https://lkml.kernel.org/r/[email protected] Fixes: 9325b8b ("tools: add skeleton code for userland testing of VMA logic") Signed-off-by: Suren Baghdasaryan <[email protected]> Reviewed-by: Lorenzo Stoakes <[email protected]> Cc: Jann Horn <[email protected]> Cc: Liam R. Howlett <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 264a88c commit 4bbb6df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/testing/shared/linux/maple_tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#define atomic_t int32_t
33
#define atomic_inc(x) uatomic_inc(x)
44
#define atomic_read(x) uatomic_read(x)
5-
#define atomic_set(x, y) do {} while (0)
5+
#define atomic_set(x, y) uatomic_set(x, y)
66
#define U8_MAX UCHAR_MAX
77
#include "../../../../include/linux/maple_tree.h"

tools/testing/vma/linux/atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define atomic_t int32_t
77
#define atomic_inc(x) uatomic_inc(x)
88
#define atomic_read(x) uatomic_read(x)
9-
#define atomic_set(x, y) do {} while (0)
9+
#define atomic_set(x, y) uatomic_set(x, y)
1010
#define U8_MAX UCHAR_MAX
1111

1212
#endif /* _LINUX_ATOMIC_H */

0 commit comments

Comments
 (0)