提交 37682177 编写于 作者: P Peter Fritzsche 提交者: Linus Torvalds

asm-generic: don't warn that atomic_t is only 24 bit

32-bit Sparc used to only allow usage of 24-bit of it's atomic_t type.
This was corrected with linux 2.6.3 when Keith M Wesolowski changed the
implementation to use the parisc approach of having an array of spinlocks
to protect the atomic_t.

These warnings were also removed from the sparc implementation when the
new implementation was merged in BKrev:402e4949VThdc6D3iaosSFUgabMfvw, but
the warning still remained in some other places without any 24-bit-only
atomic_t implementation inside the kernel.

We should remove these warnings to allow users to rely on the full 32-bit
range of atomic_t.
Signed-off-by: NPeter Fritzsche <peter.fritzsche@gmx.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fc62f2f1
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
* atomic_read - read atomic variable * atomic_read - read atomic variable
* @v: pointer of type atomic_t * @v: pointer of type atomic_t
* *
* Atomically reads the value of @v. Note that the guaranteed * Atomically reads the value of @v.
* useful range of an atomic_t is only 24 bits.
*/ */
#define atomic_read(v) (*(volatile int *)&(v)->counter) #define atomic_read(v) (*(volatile int *)&(v)->counter)
...@@ -40,8 +39,7 @@ ...@@ -40,8 +39,7 @@
* @v: pointer of type atomic_t * @v: pointer of type atomic_t
* @i: required value * @i: required value
* *
* Atomically sets the value of @v to @i. Note that the guaranteed * Atomically sets the value of @v to @i.
* useful range of an atomic_t is only 24 bits.
*/ */
#define atomic_set(v, i) (((v)->counter) = (i)) #define atomic_set(v, i) (((v)->counter) = (i))
...@@ -53,7 +51,6 @@ ...@@ -53,7 +51,6 @@
* @v: pointer of type atomic_t * @v: pointer of type atomic_t
* *
* Atomically adds @i to @v and returns the result * Atomically adds @i to @v and returns the result
* Note that the guaranteed useful range of an atomic_t is only 24 bits.
*/ */
static inline int atomic_add_return(int i, atomic_t *v) static inline int atomic_add_return(int i, atomic_t *v)
{ {
...@@ -75,7 +72,6 @@ static inline int atomic_add_return(int i, atomic_t *v) ...@@ -75,7 +72,6 @@ static inline int atomic_add_return(int i, atomic_t *v)
* @v: pointer of type atomic_t * @v: pointer of type atomic_t
* *
* Atomically subtracts @i from @v and returns the result * Atomically subtracts @i from @v and returns the result
* Note that the guaranteed useful range of an atomic_t is only 24 bits.
*/ */
static inline int atomic_sub_return(int i, atomic_t *v) static inline int atomic_sub_return(int i, atomic_t *v)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册