PM/Hibernate: use rb_entry
Subsystems (2)
PATCH 1/1 PM/Hibernate: use rb_entry
From: Davidlohr Bueso <[email protected]>
Since the software suspend extents are organized in an rbtree, use rb_entry instead of container_of, as it is semantically more appropriate in order to get a node as it is iterated.
Signed-off-by Davidlohr Bueso <[email protected]>
--- kernel/power/swap.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/power/swap.c +2 -2
@@ -109,7 +109,7 @@ static int swsusp_extents_insert(unsigned long swap_offset)/* Figure out where to put the new node */ while (*new) { - ext = container_of(*new, struct swsusp_extent, node); + ext = rb_entry(*new, struct swsusp_extent, node); parent = *new;if (swap_offset < ext->start) {/* Try to merge */
@@ -175,7 +175,7 @@ void free_all_swap_pages(int swap)struct swsusp_extent *ext;unsigned long offset; - ext = container_of(node, struct swsusp_extent, node); + ext = rb_entry(node, struct swsusp_extent, node);rb_erase (node, &swsusp_extents);for (offset = ext->start; offset <= ext->end; offset++)swap_free (swp_entry (swap, offset));
Signature · 1 line
1.7.4.1
Quoted 7 lines · Davidlohr Bueso
From: Davidlohr Bueso <[email protected]>
Since the software suspend extents are organized in an rbtree, use
rb_entryinstead ofcontainer_of, as it is semantically more appropriate in order to get a node as it is iterated.Signed-off-by Davidlohr Bueso <[email protected]>
ACK.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 10 lines · Pavel Machek
Quoted 7 lines · Davidlohr Bueso
From: Davidlohr Bueso <[email protected]>
Since the software suspend extents are organized in an rbtree, use
rb_entryinstead ofcontainer_of, as it is semantically more appropriate in order to get a node as it is iterated.Signed-off-by Davidlohr Bueso <[email protected]>ACK.
ping about this...
thanks.