Re: [patch 14/16] sparc: Replace old style lock initializer

Thomas Gleixner
2009-11-07T12:16:48Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1954 bytes --]

On Fri, 6 Nov 2009, David Miller wrote:

> From: David Miller <davem@davemloft.net>
> Date: Fri, 06 Nov 2009 22:18:34 -0800 (PST)
>
> > From: Thomas Gleixner <tglx@linutronix.de>
> > Date: Fri, 06 Nov 2009 22:42:14 -0000
> >
> >> SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.
> >>
> >> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> >
> > Applied to sparc-next-2.6, thanks.
>
> This breaks the build:
>
> /home/davem/src/GIT/sparc-next-2.6/arch/sparc/include/asm/rwsem.h:39: error: expected identifier or ‘(’ before ‘{’ token
> /home/davem/src/GIT/sparc-next-2.6/arch/sparc/include/asm/rwsem.h:39: error: expected identifier or ‘(’ before ‘}’ token
> make[1]: *** [arch/sparc/kernel/asm-offsets.s] Error 1
> make: *** [prepare0] Error 2

Darn, I compiled it but the 32bit build does not use that file :)
Working version below.

Thanks,

tglx
---
Subject: sparc: Replace old style lock initializer
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 06 Nov 2009 22:06:35 +0100

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
arch/sparc/include/asm/rwsem.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/sparc/include/asm/rwsem.h
===================================================================
--- linux-2.6.orig/arch/sparc/include/asm/rwsem.h
+++ linux-2.6/arch/sparc/include/asm/rwsem.h
@@ -35,8 +35,8 @@ struct rw_semaphore {
#endif

#define __RWSEM_INITIALIZER(name) \
-{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
- __RWSEM_DEP_MAP_INIT(name) }
+{ RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
+ LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }

#define DECLARE_RWSEM(name) \
struct rw_semaphore name = __RWSEM_INITIALIZER(name)