The following commit has been merged in the merge/master branch: commit 4e4c770352f96df09cb2c336bb3fe6ea9d8beaf4 Merge: aa020218f6126ca8b4c2a2deb2a640cace665aa2 803bae00f0ed480ed4be0b28792847162b0b91bc Author: Antonio Quartulli ordex@autistici.org Date: Wed Nov 14 20:42:47 2012 +0100
Merge remote-tracking branch 'pkg/next' into merge/master
diff --combined net/batman-adv/bridge_loop_avoidance.c index b6da6ae,fc56ea2..fc56ea2 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@@ -43,8 -43,8 +43,8 @@@ static inline uint32_t batadv_choose_cl struct batadv_claim *claim = (struct batadv_claim *)data; uint32_t hash = 0;
- batadv_hash_bytes(&hash, &claim->addr, sizeof(claim->addr)); - batadv_hash_bytes(&hash, &claim->vid, sizeof(claim->vid)); + hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr)); + hash = batadv_hash_bytes(hash, &claim->vid, sizeof(claim->vid));
hash += (hash << 3); hash ^= (hash >> 11); @@@ -60,8 -60,8 +60,8 @@@ static inline uint32_t batadv_choose_ba struct batadv_claim *claim = (struct batadv_claim *)data; uint32_t hash = 0;
- batadv_hash_bytes(&hash, &claim->addr, sizeof(claim->addr)); - batadv_hash_bytes(&hash, &claim->vid, sizeof(claim->vid)); + hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr)); + hash = batadv_hash_bytes(hash, &claim->vid, sizeof(claim->vid));
hash += (hash << 3); hash ^= (hash >> 11); diff --combined net/batman-adv/hash.h index f173427,e053339..e053339 --- a/net/batman-adv/hash.h +++ b/net/batman-adv/hash.h @@@ -86,17 -86,21 +86,21 @@@ static inline void batadv_hash_delete(s * @hash: previous hash value * @data: data to be hashed * @size: number of bytes to be hashed + * + * Returns the new hash value. */ - static inline void batadv_hash_bytes(uint32_t *hash, void *data, uint32_t size) + static inline uint32_t batadv_hash_bytes(uint32_t hash, 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); + hash += key[i]; + hash += (hash << 10); + hash ^= (hash >> 6); } + return hash; }
/**