Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / net / batman-adv / hash.h
index 539fc12667938f75319b34f3b0f4b45551d54053..5065f50c9c3c753d2371da542735250d789a8e8c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2014 B.A.T.M.A.N. contributors:
+/* Copyright (C) 2006-2015 B.A.T.M.A.N. contributors:
  *
  * Simon Wunderlich, Marek Lindner
  *
 #ifndef _NET_BATMAN_ADV_HASH_H_
 #define _NET_BATMAN_ADV_HASH_H_
 
+#include "main.h"
+
+#include <linux/compiler.h>
 #include <linux/list.h>
+#include <linux/rculist.h>
+#include <linux/spinlock.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+
+struct lock_class_key;
 
 /* callback to a compare function.  should compare 2 element datas for their
  * keys, return 0 if same and not 0 if not same
@@ -79,28 +88,6 @@ static inline void batadv_hash_delete(struct batadv_hashtable *hash,
        batadv_hash_destroy(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