Subject: compile error in __cmpxchg_u32

From: Yoichi Yuasa <[email-masked]>
Date: Wed, 10 Dec 2003 13:09:16 +0900

Hi,

I found following error in 2.6, when I compiled.

include/asm/system.h: In function `__cmpxchg_u32':
include/asm/system.h:407: error: `val' undeclared (first use in this function)
include/asm/system.h:407: error: (Each undeclared identifier is reported only once
include/asm/system.h:407: error: for each function it appears in.)

I made patch. Is this patch right?

Yoichi

diff -aruN --exclude=CVS --exclude=.cvsignore linux.orig/include/asm-mips/system.h linux/include/asm-mips/system.h
--- linux.orig/include/asm-mips/system.h	2003-12-03 11:30:36.000000000 +0900
+++ linux/include/asm-mips/system.h	2003-12-09 11:21:08.000000000 +0900
@@ -404,7 +404,8 @@
 
 	local_irq_save(flags);
 	retval = *m;
-	*m = val;
+	if (retval == old)
+		*m = new;
 	local_irq_restore(flags);	/* implies memory barrier  */
 #endif
 
@@ -440,7 +441,8 @@
 
 	local_irq_save(flags);
 	retval = *m;
-	*m = val;
+	if (retval == old)
+		*m = new;
 	local_irq_restore(flags);	/* implies memory barrier  */
 #endif

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 12 Dec 2003 14:11:14 +0100

> I made patch. Is this patch right?

Yes, applied.

  Ralf