[PATCH] fix atomic_sub_if_positive() and atomic64_sub_if_positive()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ralf,

I found the mistake about return value of atomic_sub_if_positive()  and atomic64_sub_if_positive().

Please apply this patch to v2.6 CVS tree.

Yoichi


diff -urN -X dontdiff linux-orig/include/asm-mips/atomic.h linux/include/asm-mips/atomic.h
--- linux-orig/include/asm-mips/atomic.h	Fri May 28 23:44:14 2004
+++ linux/include/asm-mips/atomic.h	Sun May 30 12:06:20 2004
@@ -228,7 +228,7 @@
 static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
 {
 	unsigned long flags;
-	int temp, result;
+	int temp;
 
 	spin_lock_irqsave(&atomic_lock, flags);
 	temp = v->counter;
@@ -237,7 +237,7 @@
 		v->counter = temp;
 	spin_unlock_irqrestore(&atomic_lock, flags);
 
-	return result;
+	return temp;
 }
 
 #endif /* CONFIG_CPU_HAS_LLSC */
@@ -511,7 +511,7 @@
 static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
 {
 	unsigned long flags;
-	long temp, result;
+	long temp;
 
 	spin_lock_irqsave(&atomic_lock, flags);
 	temp = v->counter;
@@ -520,7 +520,7 @@
 		v->counter = temp;
 	spin_unlock_irqrestore(&atomic_lock, flags);
 
-	return result;
+	return temp;
 }
 
 #endif /* CONFIG_CPU_HAS_LLDSCD */


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux