Re: [patch] spinlocks: remove 'volatile'

Chuck Ebbert
2006-07-07T10:25:04Z

In-Reply-To: <Pine.LNX.4.64.0607061333190.3869@g5.osdl.org>

On Thu, 6 Jul 2006 13:34:14 -0700, Linus Torvalds wrote:

> > So I _think_ that we should change the "=m" to the much more correct "+m"
> > at the same time (or before - it's really a bug-fix regardless) as
> > removing the "volatile".
>
> Here's a first cut (UNTESTED!) for x86. I didn't check any other
> architectures, I bet they have similar problems.

> #define __raw_spin_unlock_string \
> "movb $1,%0" \
> - :"=m" (lock->slock) : : "memory"
> + :"+m" (lock->slock) : : "memory"

This really is just an overwrite of whatever is there. OTOH I can't see
how this change could hurt anything..

--
Chuck
"You can't read a newspaper if you can't read." --George W. Bush