lkml.org 
[lkml]   [2003]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Define hash_mem in lib/hash.c to apply hash_long to an arbitraty piece of memory.

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/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.048 / U:18.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site