From: Mike Frysinger Date: Tue, 26 Jul 2011 23:09:10 +0000 (-0700) Subject: asm-generic/atomic.h: fix type used in atomic_clear_mask X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f6081bd3f8152cdd3d857f55631bbb4b72182b82;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Arun Sharma Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) return c; } -static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) +/** + * atomic_clear_mask - Atomically clear bits in atomic variable + * @mask: Mask of the bits to be cleared + * @v: pointer of type atomic_t + * + * Atomically clears the bits set in @mask from @v + */ +static inline void atomic_clear_mask(unsigned long mask, atomic_t *v) { unsigned long flags; mask = ~mask; raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */ - *addr &= mask; + v->counter &= mask; raw_local_irq_restore(flags); }