Skip to content

Commit 3768217

Browse files
Peter Fritzschetorvalds
authored andcommitted
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: Peter Fritzsche <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent fc62f2f commit 3768217

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

include/asm-generic/atomic.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
* atomic_read - read atomic variable
3131
* @v: pointer of type atomic_t
3232
*
33-
* Atomically reads the value of @v. Note that the guaranteed
34-
* useful range of an atomic_t is only 24 bits.
33+
* Atomically reads the value of @v.
3534
*/
3635
#define atomic_read(v) (*(volatile int *)&(v)->counter)
3736

@@ -40,8 +39,7 @@
4039
* @v: pointer of type atomic_t
4140
* @i: required value
4241
*
43-
* Atomically sets the value of @v to @i. Note that the guaranteed
44-
* useful range of an atomic_t is only 24 bits.
42+
* Atomically sets the value of @v to @i.
4543
*/
4644
#define atomic_set(v, i) (((v)->counter) = (i))
4745

@@ -53,7 +51,6 @@
5351
* @v: pointer of type atomic_t
5452
*
5553
* Atomically adds @i to @v and returns the result
56-
* Note that the guaranteed useful range of an atomic_t is only 24 bits.
5754
*/
5855
static inline int atomic_add_return(int i, atomic_t *v)
5956
{
@@ -75,7 +72,6 @@ static inline int atomic_add_return(int i, atomic_t *v)
7572
* @v: pointer of type atomic_t
7673
*
7774
* Atomically subtracts @i from @v and returns the result
78-
* Note that the guaranteed useful range of an atomic_t is only 24 bits.
7975
*/
8076
static inline int atomic_sub_return(int i, atomic_t *v)
8177
{

0 commit comments

Comments
 (0)