Re: [PATCH] X86-32: Let gcc decide whether to inline memcpy was Re: New x86 warning

From: Andi Kleen
Date: Thu Apr 23 2009 - 02:05:57 EST


> > It's a very attractive patch because it removes a lot of code:
>
> I think this patch is great. Perhaps this would be a good time to also
> clean out memset for x86_32? (If needed, I can start a new email

Yes looks reasonable. You can add

Reviewed-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

if you fix the comment below.

In fact it should be synced to do the same as on 64bit which already
does all that and was originally written for gcc 3.1/3.2 ...

-Andi
> +void *__memset(void *s, char c, size_t count)
> +{
> + int d0, d1;
> + asm volatile("rep\n\t"
> + "stosb"
> + : "=&c" (d0), "=&D" (d1)
> + : "a" (c), "1" (s), "0" (count)
> + : "memory");
> + return s;
> +}
> +EXPORT_SYMBOL(__memset);

I suspect _memset is not needed anymore, just memset() alone
should be enough. So remove the wrapper below.

> +
> void *memset(void *s, int c, size_t count)
> {
> return __memset(s, c, count);
> --
> 1.6.2
>

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/