* [PATCH] fix atomic_sub_if_positive() and atomic64_sub_if_positive()
@ 2004-06-03 14:13 Yoichi Yuasa
2004-06-03 14:21 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Yoichi Yuasa @ 2004-06-03 14:13 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yuasa, linux-mips
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 */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-03 14:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-03 14:13 [PATCH] fix atomic_sub_if_positive() and atomic64_sub_if_positive() Yoichi Yuasa
2004-06-03 14:21 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox