Re: [PATCH] x86: fix inline assembly constraints

From: Jike Song
Date: Wed Oct 29 2008 - 22:33:10 EST


On Thu, Oct 30, 2008 at 12:34 AM, Ingo Molnar <mingo@xxxxxxx> wrote:
>
> * Jike Song <albcamus@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/