Commit 47087eeb authored by Geliang Tang's avatar Geliang Tang Committed by Rafael J. Wysocki

PM / Hibernate: Use rb_entry() instead of container_of()

To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 7a308bb3
...@@ -201,7 +201,7 @@ void free_all_swap_pages(int swap) ...@@ -201,7 +201,7 @@ void free_all_swap_pages(int swap)
struct swsusp_extent *ext; struct swsusp_extent *ext;
unsigned long offset; unsigned long offset;
ext = container_of(node, struct swsusp_extent, node); ext = rb_entry(node, struct swsusp_extent, node);
rb_erase(node, &swsusp_extents); rb_erase(node, &swsusp_extents);
for (offset = ext->start; offset <= ext->end; offset++) for (offset = ext->start; offset <= ext->end; offset++)
swap_free(swp_entry(swap, offset)); swap_free(swp_entry(swap, offset));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment