On Tuesday, October 16, 2012 04:23:15 Simon Wunderlich wrote:
/**
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 0 on success, 1 if the element already is in the hash
and -1 on error.
- */
+static inline void 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);
}
+}
Seems the function lacks the documented return behavior .. ;-)
Cheers, Marek