diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2018-03-31 18:00:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-06-21 12:22:02 -0400 |
commit | 75a040ff14d9a99fc041f5e1d8f09541cab13ba4 (patch) | |
tree | ca8f30d563d6f20a92b9afa6f1ea2459e064aa20 | |
parent | 7cc7eaad49c30ac165ecf84d95b26f7e0d53bd97 (diff) |
locking/refcounts: Include fewer headers in <linux/refcount.h>
Debloat <linux/refcount.h>'s dependencies:
- <linux/kernel.h> is not needed, but <linux/compiler.h> is.
- <linux/mutex.h> is not needed, only a forward declaration of "struct mutex".
- <linux/spinlock.h> is not needed, <linux/spinlock_types.h> is enough.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Link: https://lkml.kernel.org/lkml/20180331220036.GA7676@avx2
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/refcount.h | 1 | ||||
-rw-r--r-- | include/linux/refcount.h | 7 | ||||
-rw-r--r-- | lib/refcount.c | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/include/asm/refcount.h b/arch/x86/include/asm/refcount.h index 4cf11d88d3b3..19b90521954c 100644 --- a/arch/x86/include/asm/refcount.h +++ b/arch/x86/include/asm/refcount.h | |||
@@ -5,6 +5,7 @@ | |||
5 | * PaX/grsecurity. | 5 | * PaX/grsecurity. |
6 | */ | 6 | */ |
7 | #include <linux/refcount.h> | 7 | #include <linux/refcount.h> |
8 | #include <asm/bug.h> | ||
8 | 9 | ||
9 | /* | 10 | /* |
10 | * This is the first portion of the refcount error handling, which lives in | 11 | * This is the first portion of the refcount error handling, which lives in |
diff --git a/include/linux/refcount.h b/include/linux/refcount.h index 4193c41e383a..c36addd27dd5 100644 --- a/include/linux/refcount.h +++ b/include/linux/refcount.h | |||
@@ -3,9 +3,10 @@ | |||
3 | #define _LINUX_REFCOUNT_H | 3 | #define _LINUX_REFCOUNT_H |
4 | 4 | ||
5 | #include <linux/atomic.h> | 5 | #include <linux/atomic.h> |
6 | #include <linux/mutex.h> | 6 | #include <linux/compiler.h> |
7 | #include <linux/spinlock.h> | 7 | #include <linux/spinlock_types.h> |
8 | #include <linux/kernel.h> | 8 | |
9 | struct mutex; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * struct refcount_t - variant of atomic_t specialized for reference counts | 12 | * struct refcount_t - variant of atomic_t specialized for reference counts |
diff --git a/lib/refcount.c b/lib/refcount.c index 0eb48353abe3..4bd842f20749 100644 --- a/lib/refcount.c +++ b/lib/refcount.c | |||
@@ -35,7 +35,9 @@ | |||
35 | * | 35 | * |
36 | */ | 36 | */ |
37 | 37 | ||
38 | #include <linux/mutex.h> | ||
38 | #include <linux/refcount.h> | 39 | #include <linux/refcount.h> |
40 | #include <linux/spinlock.h> | ||
39 | #include <linux/bug.h> | 41 | #include <linux/bug.h> |
40 | 42 | ||
41 | #ifdef CONFIG_REFCOUNT_FULL | 43 | #ifdef CONFIG_REFCOUNT_FULL |