Re: [PATCH] Define hash_mem in lib/hash.c to apply hash_long to an arbitraty piece of memory.

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Jan 07 2003 - 01:44:26 EST


On Tue, 7 Jan 2003, Neil Brown wrote:
> + if (unlikely(IsLongAligned(buf))) {
> +
> + /* Some architectures don't like dereferencing a long
> + * pointer that isn't aligned, so we do it by hand...
> + */
> + while (len >= BYTES_PER_LONG) {
> + memcpy(&l, buf, BYTES_PER_LONG);

Ugh. What a crock.

This is what we have "get_unaligned()" for.

                Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 07 2003 - 22:00:34 EST