Skip to contentSkip to conversation

Phonet:fix build problem

PATCH In review Alexander Beregalov 4 participants 8 messages Mar 20, 2009 – Mar 31, 2009

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Phonet:fix build problem

net/phonet/pep.c: In function 'pipe_rcv_status':
net/phonet/pep.c:262: error: lvalue required as left operand of assignment

---

 net/phonet/pep.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/phonet/pep.c +2 -1
index 8ad2b53..9a1aefa 100644
@@ -259,7 +259,8 @@ static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)
 	case PN_PEP_IND_ID_MCFC_GRANT_CREDITS:
 		if (pn->tx_fc != PN_MULTI_CREDIT_FLOW_CONTROL)
 			break;
-		atomic_add(wake = hdr->data[4], &pn->tx_credits);
+		wake = hdr->data[4];
+		atomic_add(wake, &pn->tx_credits);
 		break;
 
 	default:
maintainer
#1 lore raw

From: Alexander Beregalov <[email protected]>
Date: Fri, 20 Mar 2009 14:58:38 +0300

Quoted 4 lines

net/phonet/pep.c: In function 'pipe_rcv_status':
net/phonet/pep.c:262: error: lvalue required as left operand of assignment

What platform hits this problem?

I think that platform's atomic_add() implementation should be fixed instead.

#2 lore raw

2009/3/22 David Miller <[email protected]>:

Quoted 6 lines

From: Alexander Beregalov <[email protected]>
Date: Fri, 20 Mar 2009 14:58:38 +0300

Quoted 3 lines

net/phonet/pep.c: In function 'pipe_rcv_status':
net/phonet/pep.c:262: error: lvalue required as left operand of assignment

Quoted 6 lines
Quoted 1 line

What platform hits this problem?

I think that platform's atomic_add() implementation should be fixed instead.

It is parisc, CC added.

maintainer
#3 lore raw
Quoted 7 lines · Alexander Beregalov

2009/3/22 David Miller <[email protected]>:

Quoted 6 lines

From: Alexander Beregalov <[email protected]>
Date: Fri, 20 Mar 2009 14:58:38 +0300

Quoted 3 lines

net/phonet/pep.c: In function 'pipe_rcv_status':
net/phonet/pep.c:262: error: lvalue required as left operand of assignment

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

What platform hits this problem?

I think that platform's atomic_add() implementation should be fixed instead.

It is parisc, CC added.

Looks like a macro argument screw up in atomic.h

This should fix it (uncompiled, of course).

James

---

arch/parisc/include/asm/atomic.h +9 -9
index edbfe25..ada3e53 100644
@@ -25,7 +25,7 @@
  * Since "a" is usually an address, use one spinlock per cacheline.
  */
 #  define ATOMIC_HASH_SIZE 4
-#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
+#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
 
 extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
 
@@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 
 #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
-#define atomic_add(i,v)	((void)(__atomic_add_return( ((int)i),(v))))
-#define atomic_sub(i,v)	((void)(__atomic_add_return(-((int)i),(v))))
+#define atomic_add(i,v)	((void)(__atomic_add_return( ((int)(i)),(v))))
+#define atomic_sub(i,v)	((void)(__atomic_add_return(-((int)(i)),(v))))
 #define atomic_inc(v)	((void)(__atomic_add_return(   1,(v))))
 #define atomic_dec(v)	((void)(__atomic_add_return(  -1,(v))))
 
-#define atomic_add_return(i,v)	(__atomic_add_return( ((int)i),(v)))
-#define atomic_sub_return(i,v)	(__atomic_add_return(-((int)i),(v)))
+#define atomic_add_return(i,v)	(__atomic_add_return( ((int)(i)),(v)))
+#define atomic_sub_return(i,v)	(__atomic_add_return(-((int)(i)),(v)))
 #define atomic_inc_return(v)	(__atomic_add_return(   1,(v)))
 #define atomic_dec_return(v)	(__atomic_add_return(  -1,(v)))
 
@@ -289,13 +289,13 @@ atomic64_read(const atomic64_t *v)
 	return v->counter;
 }
 
-#define atomic64_add(i,v)	((void)(__atomic64_add_return( ((s64)i),(v))))
-#define atomic64_sub(i,v)	((void)(__atomic64_add_return(-((s64)i),(v))))
+#define atomic64_add(i,v)	((void)(__atomic64_add_return( ((s64)(i)),(v))))
+#define atomic64_sub(i,v)	((void)(__atomic64_add_return(-((s64)(i)),(v))))
 #define atomic64_inc(v)		((void)(__atomic64_add_return(   1,(v))))
 #define atomic64_dec(v)		((void)(__atomic64_add_return(  -1,(v))))
 
-#define atomic64_add_return(i,v)	(__atomic64_add_return( ((s64)i),(v)))
-#define atomic64_sub_return(i,v)	(__atomic64_add_return(-((s64)i),(v)))
+#define atomic64_add_return(i,v)	(__atomic64_add_return( ((s64)(i)),(v)))
+#define atomic64_sub_return(i,v)	(__atomic64_add_return(-((s64)(i)),(v)))
 #define atomic64_inc_return(v)		(__atomic64_add_return(   1,(v)))
 #define atomic64_dec_return(v)		(__atomic64_add_return(  -1,(v)))
 
#4 lore raw
Quoted 9 lines · James Bottomley
Quoted 4 lines
Quoted 2 lines

I think that platform's atomic_add() implementation should be fixed instead.

It is parisc, CC added.

Looks like a macro argument screw up in atomic.h

This should fix it (uncompiled, of course).

Looks correct to me. Applied. Thanks everyone.

#5 lore raw
Quoted 4 lines · Kyle McMartin
Quoted 3 lines · James Bottomley
Quoted 3 lines
Quoted 2 lines

I think that platform's atomic_add() implementation should be fixed instead.

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

It is parisc, CC added.

Looks like a macro argument screw up in atomic.h

This should fix it (uncompiled, of course).

Looks correct to me. Applied. Thanks everyone.

Oh, bah, want to resend that with a sign-off, James?

regards, Kyle

maintainer
#6 lore raw
Quoted 9 lines · Kyle McMartin
Quoted 8 lines · Kyle McMartin
Quoted 7 lines · James Bottomley
Quoted 4 lines
Quoted 2 lines

I think that platform's atomic_add() implementation should be fixed instead.

It is parisc, CC added.

Looks like a macro argument screw up in atomic.h

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This should fix it (uncompiled, of course).

Looks correct to me. Applied. Thanks everyone.

Oh, bah, want to resend that with a sign-off, James?

You can add:

James

#7 lore raw
Quoted 13 lines · James Bottomley
Quoted 12 lines · Kyle McMartin
Quoted 11 lines · Kyle McMartin
Quoted 9 lines · James Bottomley
Quoted 4 lines
Quoted 2 lines

I think that platform's atomic_add() implementation should be fixed instead.

It is parisc, CC added.

Looks like a macro argument screw up in atomic.h

This should fix it (uncompiled, of course).

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Looks correct to me. Applied. Thanks everyone.

Oh, bah, want to resend that with a sign-off, James?

You can add:

Thanks! Sorted.

cheers, Kyle