Thread (15 messages) flat view 15 messages, 4 authors, 2012-08-07

Re: [RFC v3 1/7] hashtable: introduce a small and naive hashtable

From: Josh Triplett <josh@joshtriplett.org>
Date: 2012-08-07 02:55:31
Also in: linux-mm, lkml

On Tue, Aug 07, 2012 at 02:45:10AM +0200, Sasha Levin wrote:
+/**
+ * hash_add - add an object to a hashtable
+ * @hashtable: hashtable to add to
+ * @bits: bit count used for hashing
+ * @node: the &struct hlist_node of the object to be added
+ * @key: the key of the object to be added
+ */
+#define hash_add(hashtable, bits, node, key)				\
+	hlist_add_head(node, &hashtable[hash_min(key, bits)]);
Any particular reason to make this a macro rather than a static inline?

Also, even if you do make it a macro, don't include the semicolon.
+/**
+ * hash_for_each_possible - iterate over all possible objects for a giver key
s/giver/given/
+ * @name: hashtable to iterate
+ * @obj: the type * to use as a loop cursor for each bucke
s/bucke/bucket/

- Josh Triplett

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help