refcount: trim headers
Subsystems (2)
PATCH 1/1 refcount: trim headers
kernel.h is not needed, but compiler.h is.
mutex.h is not needed only a forward declaration.
spinlock.h is not needed, spinlock_types.h is enough.
---
include/linux/refcount.h | 7 ++++--- lib/refcount.c | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-)
include/linux/refcount.h +4 -3
@@ -3,9 +3,10 @@#define _LINUX_REFCOUNT_H#include <linux/atomic.h> -#include <linux/mutex.h> -#include <linux/spinlock.h> -#include <linux/kernel.h> +#include <linux/compiler.h> +#include <linux/spinlock_types.h> + +struct mutex ;/** * struct refcount_t - variant of atomic_t specialized for reference counts
lib/refcount.c +2 -0
@@ -35,7 +35,9 @@* */ +#include <linux/mutex.h> #include <linux/refcount.h> +#include <linux/spinlock.h> #include <linux/bug.h> #ifdef CONFIG_REFCOUNT_FULL
Quoted 32 lines · Alexey Dobriyan
kernel.his not needed, butcompiler.his.
mutex.his not needed only a forward declaration.
spinlock.his not needed,spinlock_types.his enough.Signed-off-by Alexey Dobriyan <[email protected]>---
include/linux/refcount.h | 7 ++++--- lib/refcount.c | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-)include/linux/refcount.h +4
-3@@ -3,9 +3,10 @@#define _LINUX_REFCOUNT_H#include <linux/atomic.h> -#include <linux/mutex.h> -#include <linux/spinlock.h> -#include <linux/kernel.h> +#include <linux/compiler.h> +#include <linux/spinlock_types.h> + +struct mutex ;/** * struct refcount_t - variant of atomic_t specialized for reference counts
lib/refcount.c line 41
Quoted 7 lines
lib/refcount.c +2
-0@@ -35,7 +35,9 @@* */ +#include <linux/mutex.h> #include <linux/refcount.h> +#include <linux/spinlock.h> #include <linux/bug.h>
Doesn't build on x86-64 defconfig...
Thanks,
Ingo
Quoted 4 lines · Ingo Molnar
Quoted 4 lines
include/linux/refcount.h +0
-1#include <linux/atomic.h> -#include <linux/mutex.h>
Quoted 8 lines
include/linux/refcount.h line 9
Quoted 6 lines
include/linux/refcount.h +4
-2-#include <linux/spinlock.h> -#include <linux/kernel.h> +#include <linux/compiler.h> +#include <linux/spinlock_types.h> + +struct mutex ;Doesn't build on x86-64 defconfig...
Yeah, it doesn't :-(
Is this going to go through -tip?
Or I'll build test over both trees.
Quoted 14 lines · Alexey Dobriyan
Quoted 4 lines · Ingo Molnar
Quoted 4 lines
include/linux/refcount.h +0
-1#include <linux/atomic.h> -#include <linux/mutex.h> Quoted 8 lines
include/linux/refcount.h line 9
Quoted 6 lines
include/linux/refcount.h +4
-2-#include <linux/spinlock.h> -#include <linux/kernel.h> +#include <linux/compiler.h> +#include <linux/spinlock_types.h> + +struct mutex ;Doesn't build on x86-64 defconfig...
Quoted 3 lines
Yeah, it doesn't :-(
Is this going to go through -tip?
Or I'll build test over both trees.
Yeah, refcount changes go through the locking tree, so testing it against -tip would be useful.
Thanks,
Ingo