Commit 75a040ff authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Ingo Molnar

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: default avatarAlexey 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@avx2Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 7cc7eaad
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* PaX/grsecurity. * PaX/grsecurity.
*/ */
#include <linux/refcount.h> #include <linux/refcount.h>
#include <asm/bug.h>
/* /*
* This is the first portion of the refcount error handling, which lives in * This is the first portion of the refcount error handling, which lives in
......
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
#define _LINUX_REFCOUNT_H #define _LINUX_REFCOUNT_H
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/mutex.h> #include <linux/compiler.h>
#include <linux/spinlock.h> #include <linux/spinlock_types.h>
#include <linux/kernel.h>
struct mutex;
/** /**
* struct refcount_t - variant of atomic_t specialized for reference counts * struct refcount_t - variant of atomic_t specialized for reference counts
......
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
* *
*/ */
#include <linux/mutex.h>
#include <linux/refcount.h> #include <linux/refcount.h>
#include <linux/spinlock.h>
#include <linux/bug.h> #include <linux/bug.h>
#ifdef CONFIG_REFCOUNT_FULL #ifdef CONFIG_REFCOUNT_FULL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment