Messages in this thread Patch in this message | | | Date | Fri, 28 Feb 2014 15:41:22 +0000 | From | Will Deacon <> | Subject | Re: [PATCH 1/2] asm-generic: rwsem: ensure sem->cnt is only accessed via atomic_long_* |
| |
On Fri, Feb 28, 2014 at 12:50:06PM +0000, Peter Hurley wrote: > On 02/28/2014 07:13 AM, Will Deacon wrote: > > diff --git a/include/asm-generic/rwsem.h b/include/asm-generic/rwsem.h > > index 603a0a11e592..2b6401f9e428 100644 > > --- a/include/asm-generic/rwsem.h > > +++ b/include/asm-generic/rwsem.h > > @@ -40,14 +40,16 @@ static inline void __down_read(struct rw_semaphore *sem) > > static inline int __down_read_trylock(struct rw_semaphore *sem) > > { > > long tmp; > > + atomic_long_t *cnt = (atomic_long_t *)&sem->count; > > The shared rwsem failure paths (kernel/locking/rwsem_xadd.c) peek at > sem->count as long type, so this isn't really necessary.
Yeah, none of this patch is necessary from a technical perspective. I was just in the area and tried to make the file at least self-consistent wrt the atomic API. It's a harmless cleanup.
Will
| |