aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/hash.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2015-03-01 09:46:18 +0100
committerAntonio Quartulli <antonio@meshcoding.com>2015-06-07 17:07:17 +0200
commit36fd61cb80fcf07c20230face1a0f6e1505c8322 (patch)
treece2d9f8cf7520b14bfd302248420f3069f232299 /net/batman-adv/hash.h
parentbpf: allow programs to write to certain skb fields (diff)
downloadlinux-dev-36fd61cb80fcf07c20230face1a0f6e1505c8322.tar.xz
linux-dev-36fd61cb80fcf07c20230face1a0f6e1505c8322.zip
batman-adv: Use common Jenkins Hash implementation
An unoptimized version of the Jenkins one-at-a-time hash function is used and partially copied all over the code wherever an hashtable is used. Instead the optimized version shared between the whole kernel should be used to reduce code duplication and use better optimized code. Only the DAT code must use the old implementation because it is used as distributed hash function which has to be common for all nodes. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/hash.h')
-rw-r--r--net/batman-adv/hash.h22
1 files changed, 0 insertions, 22 deletions
diff --git a/net/batman-adv/hash.h b/net/batman-adv/hash.h
index 379e32acf2b4..bcf427cafe49 100644
--- a/net/batman-adv/hash.h
+++ b/net/batman-adv/hash.h
@@ -80,28 +80,6 @@ static inline void batadv_hash_delete(struct batadv_hashtable *hash,
}
/**
- * batadv_hash_bytes - hash some bytes and add them to the previous hash
- * @hash: previous hash value
- * @data: data to be hashed
- * @size: number of bytes to be hashed
- *
- * Returns the new hash value.
- */
-static inline uint32_t batadv_hash_bytes(uint32_t hash, const void *data,
- uint32_t size)
-{
- const unsigned char *key = data;
- int i;
-
- for (i = 0; i < size; i++) {
- hash += key[i];
- hash += (hash << 10);
- hash ^= (hash >> 6);
- }
- return hash;
-}
-
-/**
* batadv_hash_add - adds data to the hashtable
* @hash: storage hash table
* @compare: callback to determine if 2 hash elements are identical