All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic rw_semaphores, compile warnings patch
@ 2001-04-19 23:33 D.W.Howells
  2001-04-19 23:43 ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: D.W.Howells @ 2001-04-19 23:33 UTC (permalink / raw)
  To: torvalds; +Cc: dhowells, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 132 bytes --]

This patch (made against linux-2.4.4-pre4) gets rid of some warnings obtained 
when using the generic rwsem implementation.

David


[-- Attachment #2: rwsem compile warnings patch --]
[-- Type: text/plain, Size: 1369 bytes --]

diff -uNr linux-2.4.4-pre4/include/linux/rwsem.h linux/include/linux/rwsem.h
--- linux-2.4.4-pre4/include/linux/rwsem.h	Thu Apr 19 22:07:49 2001
+++ linux/include/linux/rwsem.h	Thu Apr 19 23:52:41 2001
@@ -42,20 +42,24 @@
 #include <asm/atomic.h>
 #include <linux/wait.h>
 
-#ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
-#include <linux/rwsem-spinlock.h> /* use a generic implementation */
-#else
-#include <asm/rwsem.h> /* use an arch-specific implementation */
-#endif
+struct rw_semaphore;
 
 /* defined contention handler functions for the generic case
  * - these are also used for the exchange-and-add based algorithm
  */
-#if defined(CONFIG_RWSEM_GENERIC) || defined(CONFIG_RWSEM_XCHGADD_ALGORITHM)
+#if defined(CONFIG_RWSEM_GENERIC_SPINLOCK) || defined(CONFIG_RWSEM_XCHGADD_ALGORITHM)
 /* we use FASTCALL convention for the helpers */
 extern struct rw_semaphore *FASTCALL(rwsem_down_read_failed(struct rw_semaphore *sem));
 extern struct rw_semaphore *FASTCALL(rwsem_down_write_failed(struct rw_semaphore *sem));
 extern struct rw_semaphore *FASTCALL(rwsem_wake(struct rw_semaphore *sem));
+#endif
+
+/* access the actual implementation of the rwsems
+ */
+#ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
+#include <linux/rwsem-spinlock.h> /* use a generic implementation */
+#else
+#include <asm/rwsem.h> /* use an arch-specific implementation */
 #endif
 
 #ifndef rwsemtrace

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

* Re: [PATCH] generic rw_semaphores, compile warnings patch
  2001-04-19 23:33 [PATCH] generic rw_semaphores, compile warnings patch D.W.Howells
@ 2001-04-19 23:43 ` David S. Miller
  2001-04-20  7:50   ` David Howells
  0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2001-04-19 23:43 UTC (permalink / raw)
  To: D.W.Howells; +Cc: torvalds, dhowells, linux-kernel


D.W.Howells writes:
 > This patch (made against linux-2.4.4-pre4) gets rid of some warnings obtained 
 > when using the generic rwsem implementation.

Have a look at pre5, this is already fixed.

Later,
David S. Miller
davem@redhat.com

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

* Re: [PATCH] generic rw_semaphores, compile warnings patch
  2001-04-19 23:43 ` David S. Miller
@ 2001-04-20  7:50   ` David Howells
  2001-04-20  7:57     ` David S. Miller
  2001-04-20 12:04     ` Ivan Kokshaysky
  0 siblings, 2 replies; 5+ messages in thread
From: David Howells @ 2001-04-20  7:50 UTC (permalink / raw)
  To: David S. Miller; +Cc: torvalds, dhowells, linux-kernel

David S. Miller <davem@redhat.com> wrote:
> D.W.Howells writes:
>  > This patch (made against linux-2.4.4-pre4) gets rid of some warnings obtained 
>  > when using the generic rwsem implementation.
>
> Have a look at pre5, this is already fixed.

Not entirely so...

There's also a missing "struct rw_semaphore;" declaration in linux/rwsem.h. It
needs to go in the gap below "#include <linux/wait.h>". Otherwise the
declarations for the contention handling functions will give warnings about
the struct being declared in the parameter list.

David

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

* Re: [PATCH] generic rw_semaphores, compile warnings patch
  2001-04-20  7:50   ` David Howells
@ 2001-04-20  7:57     ` David S. Miller
  2001-04-20 12:04     ` Ivan Kokshaysky
  1 sibling, 0 replies; 5+ messages in thread
From: David S. Miller @ 2001-04-20  7:57 UTC (permalink / raw)
  To: David Howells; +Cc: torvalds, linux-kernel


David Howells writes:
 > There's also a missing "struct rw_semaphore;" declaration in linux/rwsem.h. It
 > needs to go in the gap below "#include <linux/wait.h>". Otherwise the
 > declarations for the contention handling functions will give warnings about
 > the struct being declared in the parameter list.

Indeed, I didn't see this in my setup on sparc64 for some reason.

Later,
David S. Miller
davem@redhat.com


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

* Re: [PATCH] generic rw_semaphores, compile warnings patch
  2001-04-20  7:50   ` David Howells
  2001-04-20  7:57     ` David S. Miller
@ 2001-04-20 12:04     ` Ivan Kokshaysky
  1 sibling, 0 replies; 5+ messages in thread
From: Ivan Kokshaysky @ 2001-04-20 12:04 UTC (permalink / raw)
  To: David Howells; +Cc: David S. Miller, torvalds, dhowells, linux-kernel

On Fri, Apr 20, 2001 at 08:50:38AM +0100, David Howells wrote:
> There's also a missing "struct rw_semaphore;" declaration in linux/rwsem.h. It
> needs to go in the gap below "#include <linux/wait.h>". Otherwise the
> declarations for the contention handling functions will give warnings about
> the struct being declared in the parameter list.

Also on alpha __u16 is undeclared in rwsem.c, and old rwsem code wasn't
cleaned up properly.

Ivan.

--- 2.4.4p5/include/linux/rwsem-spinlock.h	Fri Apr 20 14:06:50 2001
+++ linux/include/linux/rwsem-spinlock.h	Fri Apr 20 15:37:28 2001
@@ -14,6 +14,8 @@
 
 #ifdef __KERNEL__
 
+#include <linux/types.h>
+
 /*
  * the semaphore definition
  */
--- 2.4.4p5/include/asm-alpha/semaphore.h	Fri Apr 20 13:53:28 2001
+++ linux/include/asm-alpha/semaphore.h	Fri Apr 20 15:37:28 2001
@@ -225,5 +225,3 @@ extern inline void up(struct semaphore *
 #endif
 
 #endif
-
-#endif
--- 2.4.4p5/arch/alpha/kernel/alpha_ksyms.c	Fri Apr 20 13:52:56 2001
+++ linux/arch/alpha/kernel/alpha_ksyms.c	Fri Apr 20 14:01:36 2001
@@ -173,9 +173,6 @@ EXPORT_SYMBOL(down);
 EXPORT_SYMBOL(down_interruptible);
 EXPORT_SYMBOL(down_trylock);
 EXPORT_SYMBOL(up);
-EXPORT_SYMBOL(__down_read_failed);
-EXPORT_SYMBOL(__down_write_failed);
-EXPORT_SYMBOL(__rwsem_wake);
 EXPORT_SYMBOL(down_read);
 EXPORT_SYMBOL(down_write);
 EXPORT_SYMBOL(up_read);

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

end of thread, other threads:[~2001-04-20 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-19 23:33 [PATCH] generic rw_semaphores, compile warnings patch D.W.Howells
2001-04-19 23:43 ` David S. Miller
2001-04-20  7:50   ` David Howells
2001-04-20  7:57     ` David S. Miller
2001-04-20 12:04     ` Ivan Kokshaysky

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.