Re: [PATCH 1 of 3] Introduce __memcpy_toio32

From: Roland Dreier
Date: Tue Dec 27 2005 - 20:09:55 EST


A couple of comments here:

> +/*
> + * Copy data to an MMIO region. MMIO space accesses are performed
> + * in the sizes indicated in each function's name.
> + */
> +void fastcall __memcpy_toio32(volatile void __iomem *d, const void *s, size_t count)
> +{
> + volatile u32 __iomem *dst = d;
> + const u32 *src = s;
> +
> + while (--count >= 0) {
> + __raw_writel(*src++, dst++);
> + }

I think the principle of least surprise calls for memcpy_toio32 to be
ordered the same way memcpy_toio is. In other words there should be a
wmb() after the loop.

Also, no need for the { } for the while loop.

> +}
> +
> +EXPORT_SYMBOL_GPL(__memcpy_toio32);

You're adding this symbol and exporting it even if the arch will
supply its own version. So this is pure kernel .text bloat...

- R.
-
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/