diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-07-26 19:09:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:47 -0400 |
commit | f6081bd3f8152cdd3d857f55631bbb4b72182b82 (patch) | |
tree | fa6cf9b5432ea33d8182d2a64465d28ecfc13315 /include/asm-generic | |
parent | 3eea44ea753923c6af90be808426ecddc482de61 (diff) |
asm-generic/atomic.h: fix type used in atomic_clear_mask
The atomic helpers are supposed to take an atomic_t pointer, not a random
unsigned long pointer. So convert atomic_clear_mask over.
While we're here, also add some nice documentation to the func.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Arun Sharma <asharma@fb.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/atomic.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 2a23da03365e..4e8ecf0693e9 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h | |||
@@ -140,13 +140,20 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) | |||
140 | return c; | 140 | return c; |
141 | } | 141 | } |
142 | 142 | ||
143 | static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | 143 | /** |
144 | * atomic_clear_mask - Atomically clear bits in atomic variable | ||
145 | * @mask: Mask of the bits to be cleared | ||
146 | * @v: pointer of type atomic_t | ||
147 | * | ||
148 | * Atomically clears the bits set in @mask from @v | ||
149 | */ | ||
150 | static inline void atomic_clear_mask(unsigned long mask, atomic_t *v) | ||
144 | { | 151 | { |
145 | unsigned long flags; | 152 | unsigned long flags; |
146 | 153 | ||
147 | mask = ~mask; | 154 | mask = ~mask; |
148 | raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */ | 155 | raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */ |
149 | *addr &= mask; | 156 | v->counter &= mask; |
150 | raw_local_irq_restore(flags); | 157 | raw_local_irq_restore(flags); |
151 | } | 158 | } |
152 | 159 | ||