Re: [PATCH v3 01/17] hashtable: introduce a small and naive hashtable
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2012-09-06 17:15:49
Also in:
dm-devel, linux-mm, linux-nfs, lkml
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2012-09-06 17:15:49
Also in:
dm-devel, linux-mm, linux-nfs, lkml
On Thu, 2012-09-06 at 18:21 +0200, Sasha Levin wrote:
On 09/06/2012 06:00 PM, Steven Rostedt wrote:quoted
quoted
quoted
I think that that code doesn't make sense. The users of hlist_for_each_* aren't supposed to be changing the loop cursor.I totally agree. Modifying the 'node' pointer is just asking for issues. Yes that is error prone, but not due to the double loop. It's due to the modifying of the node pointer that is used internally by the loop counter. Don't do that :-)While we're on this subject, I haven't actually seen hlist_for_each_entry() code that even *touches* 'pos'. Will people yell at me loudly if I change the prototype of those macros to be: hlist_for_each_entry(tpos, head, member) (Dropping the 'pos' parameter), and updating anything that calls those macros to drop it as well?
If 'pos' is no longer used in the macro, I don't see any reason for keeping it around. -- Steve -- 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>