lkml.org 
[lkml]   [2018]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

include/linux/refcount.h | 7 ++++---
lib/refcount.c | 2 ++
2 files changed, 6 insertions(+), 3 deletions(-)

--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -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
--- a/lib/refcount.c
+++ b/lib/refcount.c
@@ -35,7 +35,9 @@
*
*/

+#include <linux/mutex.h>
#include <linux/refcount.h>
+#include <linux/spinlock.h>
#include <linux/bug.h>

#ifdef CONFIG_REFCOUNT_FULL
\
 
 \ /
  Last update: 2018-03-13 20:34    [W:0.054 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site