]> err.no Git - linux-2.6/commitdiff
CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_return.
authorJesper Nilsson <jesper.nilsson@axis.com>
Mon, 21 Jan 2008 16:01:31 +0000 (17:01 +0100)
committerJesper Nilsson <jesper.nilsson@axis.com>
Fri, 8 Feb 2008 10:06:33 +0000 (11:06 +0100)
Increment and decrement before assigning to return value.

include/asm-cris/atomic.h

index 2949a945876a5c4685197927426809a61ee03999..5fc87768774a25cd0b438550a39d753d27513c85 100644 (file)
@@ -91,7 +91,7 @@ static inline int atomic_inc_return(volatile atomic_t *v)
        unsigned long flags;
        int retval;
        cris_atomic_save(v, flags);
-       retval = (v->counter)++;
+       retval = ++(v->counter);
        cris_atomic_restore(v, flags);
        return retval;
 }
@@ -101,7 +101,7 @@ static inline int atomic_dec_return(volatile atomic_t *v)
        unsigned long flags;
        int retval;
        cris_atomic_save(v, flags);
-       retval = (v->counter)--;
+       retval = --(v->counter);
        cris_atomic_restore(v, flags);
        return retval;
 }