summaryrefslogtreecommitdiff
path: root/include/linux/types.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2020-07-29 22:31:05 +1000
committerPeter Zijlstra <peterz@infradead.org>2020-07-29 16:14:18 +0200
commit7ca8cf5347f720b07a0b32a924b768f5710547e7 (patch)
tree1a7e64ab24c7c61415af5537d9c3319f37599005 /include/linux/types.h
parente885d5d94793ef342e49d55672baabbc16e32bb1 (diff)
locking/atomic: Move ATOMIC_INIT into linux/types.h
This patch moves ATOMIC_INIT from asm/atomic.h into linux/types.h. This allows users of atomic_t to use ATOMIC_INIT without having to include atomic.h as that way may lead to header loops. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Waiman Long <longman@redhat.com> Link: https://lkml.kernel.org/r/20200729123105.GB7047@gondor.apana.org.au
Diffstat (limited to 'include/linux/types.h')
-rw-r--r--include/linux/types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/types.h b/include/linux/types.h
index d3021c879179..a147977602b5 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -167,6 +167,8 @@ typedef struct {
int counter;
} atomic_t;
+#define ATOMIC_INIT(i) { (i) }
+
#ifdef CONFIG_64BIT
typedef struct {
s64 counter;