Commit 467b5fe6 authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Antonio Quartulli

batman-adv: use the const qualifier in hash functions

The data argument in each hash function should carry the
"const" qualifier as it is never modified.
Signed-off-by: default avatarAntonio Quartulli <antonio@open-mesh.com>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
parent fa706554
...@@ -57,7 +57,7 @@ static inline uint32_t batadv_choose_claim(const void *data, uint32_t size) ...@@ -57,7 +57,7 @@ static inline uint32_t batadv_choose_claim(const void *data, uint32_t size)
static inline uint32_t batadv_choose_backbone_gw(const void *data, static inline uint32_t batadv_choose_backbone_gw(const void *data,
uint32_t size) uint32_t size)
{ {
struct batadv_claim *claim = (struct batadv_claim *)data; const struct batadv_claim *claim = (struct batadv_claim *)data;
uint32_t hash = 0; uint32_t hash = 0;
hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr)); hash = batadv_hash_bytes(hash, &claim->addr, sizeof(claim->addr));
......
...@@ -89,7 +89,7 @@ static inline void batadv_hash_delete(struct batadv_hashtable *hash, ...@@ -89,7 +89,7 @@ static inline void batadv_hash_delete(struct batadv_hashtable *hash,
* *
* Returns the new hash value. * Returns the new hash value.
*/ */
static inline uint32_t batadv_hash_bytes(uint32_t hash, void *data, static inline uint32_t batadv_hash_bytes(uint32_t hash, const void *data,
uint32_t size) uint32_t size)
{ {
const unsigned char *key = data; const unsigned char *key = data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment