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

From: Falk Hueffner (falk.hueffner@student.uni-tuebingen.de)
Date: Tue Jan 07 2003 - 00:18:42 EST


Neil Brown <neilb@cse.unsw.edu.au> writes:

> +unsigned long hash_mem(void *buf, unsigned int len, unsigned int bits)
> +{
> + int hash = 0;

Shouldn't that be unsigned long?

BTW, in my experience using a good hash function is usually more
important than using a fast hash function. Especially the use of '^'
here could lead to very bad performance in obscure cases because of
bit canceling.

-- 
	Falk
-
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