projects
/
platform
/
kernel
/
linux-3.10.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b43890a
)
CRIS: Fix bugs in return value of atomic_inc_return and atomic_dec_return.
author
Jesper Nilsson
<jesper.nilsson@axis.com>
Mon, 21 Jan 2008 16:01:31 +0000
(17:01 +0100)
committer
Jesper 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
patch
|
blob
|
history
diff --git
a/include/asm-cris/atomic.h
b/include/asm-cris/atomic.h
index
2949a94
..
5fc8776
100644
(file)
--- a/
include/asm-cris/atomic.h
+++ b/
include/asm-cris/atomic.h
@@
-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;
}