linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PPC:  Prevent direct inclusion of <asm/rwsem.h>.
@ 2007-07-18 13:36 Robert P. J. Day
  2007-07-18 14:14 ` Kumar Gala
  0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2007-07-18 13:36 UTC (permalink / raw)
  To: Linux PPC Mailing List; +Cc: Paul Mackerras


Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>

---

  not compile-tested, so if there's a flaw here somewhere, feel free
to tweak it.

 arch/ppc/syslib/ocp.c       |    2 +-
 include/asm-powerpc/rwsem.h |    4 ++++
 include/asm-ppc/ocp.h       |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index 491fe9a..3f5be2c 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -44,11 +44,11 @@
 #include <linux/pm.h>
 #include <linux/bootmem.h>
 #include <linux/device.h>
+#include <linux/rwsem.h>

 #include <asm/io.h>
 #include <asm/ocp.h>
 #include <asm/errno.h>
-#include <asm/rwsem.h>
 #include <asm/semaphore.h>

 //#define DBG(x)	printk x
diff --git a/include/asm-powerpc/rwsem.h b/include/asm-powerpc/rwsem.h
index e929145..cefc147 100644
--- a/include/asm-powerpc/rwsem.h
+++ b/include/asm-powerpc/rwsem.h
@@ -1,6 +1,10 @@
 #ifndef _ASM_POWERPC_RWSEM_H
 #define _ASM_POWERPC_RWSEM_H

+#ifndef _LINUX_RWSEM_H
+#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
+#endif
+
 #ifdef __KERNEL__

 /*
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 16dbc7d..1379a4f 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -27,10 +27,10 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/device.h>
+#include <linux/rwsem.h>

 #include <asm/mmu.h>
 #include <asm/ocp_ids.h>
-#include <asm/rwsem.h>
 #include <asm/semaphore.h>

 #ifdef CONFIG_PPC_OCP
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

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

* Re: [PATCH] PPC:  Prevent direct inclusion of <asm/rwsem.h>.
  2007-07-18 13:36 [PATCH] PPC: Prevent direct inclusion of <asm/rwsem.h> Robert P. J. Day
@ 2007-07-18 14:14 ` Kumar Gala
  2007-07-18 14:20   ` Robert P. J. Day
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2007-07-18 14:14 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux PPC Mailing List, Paul Mackerras


On Jul 18, 2007, at 8:36 AM, Robert P. J. Day wrote:

>
> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>

Can you provide some commit description as to why we are doing this?

- k

>
> ---
>
>   not compile-tested, so if there's a flaw here somewhere, feel free
> to tweak it.
>
>  arch/ppc/syslib/ocp.c       |    2 +-
>  include/asm-powerpc/rwsem.h |    4 ++++
>  include/asm-ppc/ocp.h       |    2 +-
>  3 files changed, 6 insertions(+), 2 deletions(-)

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

* Re: [PATCH] PPC:  Prevent direct inclusion of <asm/rwsem.h>.
  2007-07-18 14:14 ` Kumar Gala
@ 2007-07-18 14:20   ` Robert P. J. Day
  0 siblings, 0 replies; 3+ messages in thread
From: Robert P. J. Day @ 2007-07-18 14:20 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Linux PPC Mailing List, Paul Mackerras

On Wed, 18 Jul 2007, Kumar Gala wrote:

>
> On Jul 18, 2007, at 8:36 AM, Robert P. J. Day wrote:
>
> >
> > Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
>
> Can you provide some commit description as to why we are doing this?
>
> - k
>
> >
> > ---
> >
> >   not compile-tested, so if there's a flaw here somewhere, feel free
> > to tweak it.
> >
> >  arch/ppc/syslib/ocp.c       |    2 +-
> >  include/asm-powerpc/rwsem.h |    4 ++++
> >  include/asm-ppc/ocp.h       |    2 +-
> >  3 files changed, 6 insertions(+), 2 deletions(-)

based on the pattern across all architectures, it would seem that
asm/rwsem.h is not *meant* to be included directly, but only via
linux/rwsem.h.  i'm not sure if that's the kind of rationale you're
looking for, or if you want a more technical description.

at the moment, ppc is the only architecture that is doing the above,
but it may be that there's a good reason for that that i'm just not
aware of.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

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

end of thread, other threads:[~2007-07-18 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-18 13:36 [PATCH] PPC: Prevent direct inclusion of <asm/rwsem.h> Robert P. J. Day
2007-07-18 14:14 ` Kumar Gala
2007-07-18 14:20   ` Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).