All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] refcount: trim headers
@ 2018-03-13 19:34 Alexey Dobriyan
  2018-03-31  8:36 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2018-03-13 19:34 UTC (permalink / raw)
  To: peterz; +Cc: linux-kernel, mingo

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] refcount: trim headers
  2018-03-13 19:34 [PATCH] refcount: trim headers Alexey Dobriyan
@ 2018-03-31  8:36 ` Ingo Molnar
  2018-03-31 13:39   ` Alexey Dobriyan
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2018-03-31  8:36 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: peterz, linux-kernel


* Alexey Dobriyan <adobriyan@gmail.com> wrote:

> 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>

Doesn't build on x86-64 defconfig...

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] refcount: trim headers
  2018-03-31  8:36 ` Ingo Molnar
@ 2018-03-31 13:39   ` Alexey Dobriyan
  2018-03-31 18:46     ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2018-03-31 13:39 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: peterz, linux-kernel

On Sat, Mar 31, 2018 at 10:36:32AM +0200, Ingo Molnar wrote:
> > --- a/include/linux/refcount.h
> > +++ b/include/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;

> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] refcount: trim headers
  2018-03-31 13:39   ` Alexey Dobriyan
@ 2018-03-31 18:46     ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2018-03-31 18:46 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: peterz, linux-kernel


* Alexey Dobriyan <adobriyan@gmail.com> wrote:

> On Sat, Mar 31, 2018 at 10:36:32AM +0200, Ingo Molnar wrote:
> > > --- a/include/linux/refcount.h
> > > +++ b/include/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;
> 
> > 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.

Yeah, refcount changes go through the locking tree, so testing it against -tip 
would be useful.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-31 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 19:34 [PATCH] refcount: trim headers Alexey Dobriyan
2018-03-31  8:36 ` Ingo Molnar
2018-03-31 13:39   ` Alexey Dobriyan
2018-03-31 18:46     ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.