Subject: Re: 2.6.23-rc3-mm1: kgdb build failure on powerpc

From: Andrew Morton <[email-masked]>
Date: Wed, 22 Aug 2007 12:47:43 -0700

On Wed, 22 Aug 2007 21:04:28 +0200
Mariusz Kozlowski <[email-masked]> wrote:

> Hello,
> 
> 	Got that on imac g3.
> 
>   CC      kernel/kgdb.o
> kernel/kgdb.c: In function 'kgdb_handle_exception':
> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
> kernel/kgdb.c:940: warning: type defaults to 'int' in declaration of '_o_'
> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
> kernel/kgdb.c:940: warning: type defaults to 'int' in declaration of '_n_'
> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
> kernel/kgdb.c:940: warning: type defaults to 'int' in declaration of 'type name'
> make[1]: *** [kernel/kgdb.o] Blad 1
> make: *** [kernel] Blad 2
> 

I'm not surprised.

	while (cmpxchg(&atomic_read(&debugger_active), 0, (procid + 1)) != 0) {

a) cmpxchg isn't available on all architectures

b) we can't just go and take the address of atomic_read()'s return value!

c) that's pretty ugly-looking stuff anyway.