Re: [PATCH] x86: fix inline assembly constraints

Jike Song
2008-10-30T02:31:43Z

On Thu, Oct 30, 2008 at 12:34 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Jike Song <albcamus@gmail.com> wrote:
>>
>> --
>
> that was an easy patch to act upon ;-)
>
> Ingo
>
Sorry Ingo, I missed your point. Do you mean this patch is trivial or
unnecessary?

Besides, by looking at the inline assembly in kernel, I found lots of
codes like this:

static inline void atomic_add(int i, atomic_t *v)
{
asm volatile(LOCK_PREFIX "addl %1,%0"
: "=m" (v->counter)
: "ir" (i), "m" (v->counter));
}

Yes, it works. But a little ugly.. Should this be cleaned-up with the
following?

: "+m" (v->counter)
: "ir" (i)

If you agrees, I'll send out the patch; otherwise I won't wasting your time ;-)

--
Thanks,
Jike