batman-adv: Use common Jenkins Hash implementation
[cascardo/linux.git] / net / batman-adv / originator.h
index 9133914..0b716fe 100644 (file)
@@ -75,20 +75,9 @@ void batadv_orig_node_vlan_free_ref(struct batadv_orig_node_vlan *orig_vlan);
  */
 static inline uint32_t batadv_choose_orig(const void *data, uint32_t size)
 {
-       const unsigned char *key = data;
        uint32_t hash = 0;
-       size_t i;
-
-       for (i = 0; i < 6; i++) {
-               hash += key[i];
-               hash += (hash << 10);
-               hash ^= (hash >> 6);
-       }
-
-       hash += (hash << 3);
-       hash ^= (hash >> 11);
-       hash += (hash << 15);
 
+       hash = jhash(data, ETH_ALEN, hash);
        return hash % size;
 }