From: Davidlohr Bueso Date: Mon, 22 Oct 2012 23:21:09 +0000 (+0200) Subject: PM / Hibernate: use rb_entry X-Git-Tag: next-20121024~35^2~1^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c3148fdcb239b101acdf2afc40926cca99945843;p=karo-tx-linux.git PM / Hibernate: use rb_entry 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 Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 3c9d764eb0d8..7c33ed200410 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -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 */