mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-05-20 11:44:14 +00:00
CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_return.
Increment and decrement before assigning to return value.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user