lkml.org 
[lkml]   [2014]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-02-28 17:21    [W:0.118 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site