Commit 3c1d9303 authored by Jesper Nilsson's avatar Jesper Nilsson

CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_return.

Increment and decrement before assigning to return value.
parent b43890af
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment