Thread (2 messages) flat view 2 messages, 2 authors, 2012-11-13

Re: [PATCH 01/11] batman-adv: don't rely on positions in struct for hashing

From: David Miller <davem@davemloft.net>
Date: 2012-11-13 19:24:03
Also in: batman

Possibly related (same subject, not in this thread)

From: Antonio Quartulli <redacted>
Date: Tue, 13 Nov 2012 10:15:29 +0100
quoted hunk ↗ jump to hunk
@@ -37,18 +37,26 @@ static void batadv_bla_periodic_work(struct work_struct *work);
 static void batadv_bla_send_announce(struct batadv_priv *bat_priv,
 				     struct batadv_backbone_gw *backbone_gw);
 
+static inline void 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);
+	}
+}
+
Remove the inline tag.

Return the uint32_t resulting hash value rather than passing it by
reference.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help