Commit ba5d8937 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: fix __rw_yield prototype

From: Nathan Lynch <nathanl@austin.ibm.com>

Hit this in latest bk:

include/asm/spinlock.h: In function `_raw_read_lock':
include/asm/spinlock.h:198: warning: passing arg 1 of `__rw_yield' from incompatible pointer type
include/asm/spinlock.h: In function `_raw_write_lock':
include/asm/spinlock.h:255: warning: passing arg 1 of `__rw_yield' from incompatible pointer type

This seems to have been broken by the out-of-line spinlocks patch.
You won't hit it unless you've enabled CONFIG_PPC_SPLPAR.  Use the
rwlock_t for the argument type, and move the definition of rwlock_t up
next to that of spinlock_t.
Signed-off-by: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 34201b6e
......@@ -25,6 +25,10 @@ typedef struct {
volatile unsigned int lock;
} spinlock_t;
typedef struct {
volatile signed int lock;
} rwlock_t;
#ifdef __KERNEL__
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
......@@ -55,7 +59,7 @@ static __inline__ void _raw_spin_unlock(spinlock_t *lock)
/* We only yield to the hypervisor if we are in shared processor mode */
#define SHARED_PROCESSOR (get_paca()->lppaca.xSharedProc)
extern void __spin_yield(spinlock_t *lock);
extern void __rw_yield(spinlock_t *lock);
extern void __rw_yield(rwlock_t *lock);
#else /* SPLPAR || ISERIES */
#define __spin_yield(x) barrier()
#define __rw_yield(x) barrier()
......@@ -134,10 +138,6 @@ static void __inline__ _raw_spin_lock_flags(spinlock_t *lock, unsigned long flag
* irq-safe write-lock, but readers can get non-irqsafe
* read-locks.
*/
typedef struct {
volatile signed int lock;
} rwlock_t;
#define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment