On Tuesday 25 March 2008 06:02:22 Ian Abbott wrote:On 20/03/08 18:39, Rob Landley wrote:On Thursday 20 March 2008 10:29:57 Ian Abbott wrote:I don't know the rationale, but all the code I can see uses rb_entry()From: Ian Abbott <abbotti@xxxxxxxxx>I have no objection to the patch (and the my_search thing seems like an
The description of the rb_entry() macro in Documentation/rbtree.txt
seems incorrect. This patch improves it (hopefully). Also I changed the
example code to call the previous 'my_search()' example instead of an
undefined 'mysearch()'.
obvious typo), but is there a reason to prefer rb_entry() rather than
container_of()? If so, the rationale might be a good thing to add to the
documentation...
and not container_of().
Except container_of() works, which is a nice thing to know, and it already mentions rb_entry() as another way to do it. If someone could explain _why_ to use one over the other, that would be a good thing to add.
Again, I don't care much either way, I just want to know what the point is of choosing one over the other that makes changing what's there worth bothering with. You're changing the documentation to hide the fact that rb_entry() is basically another name for container_of(), and this is supposed to be an improvement?