Skip to content

Commit

Permalink
PM / Hibernate: use rb_entry
Browse files Browse the repository at this point in the history
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 <dave@gnu.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Davidlohr Bueso authored and Rafael J. Wysocki committed Nov 14, 2012
1 parent 883ee4f commit 8316bd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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 */
Expand Down

0 comments on commit 8316bd7

Please sign in to comment.