Skip to content

Commit

Permalink
CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_re…
Browse files Browse the repository at this point in the history
…turn.

Increment and decrement before assigning to return value.
  • Loading branch information
Jesper Nilsson committed Feb 8, 2008
1 parent b43890a commit 3c1d930
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/asm-cris/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 3c1d930

Please sign in to comment.