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

Linus Torvalds (torvalds@transmeta.com)
Mon, 6 Jan 2003 22:44:26 -0800 (PST)


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/