Skip to content

Commit 8316bd7

Browse files
Davidlohr Buesorafaeljw
authored andcommitted
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 <dave@gnu.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 883ee4f commit 8316bd7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/power/swap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int swsusp_extents_insert(unsigned long swap_offset)
126126

127127
/* Figure out where to put the new node */
128128
while (*new) {
129-
ext = container_of(*new, struct swsusp_extent, node);
129+
ext = rb_entry(*new, struct swsusp_extent, node);
130130
parent = *new;
131131
if (swap_offset < ext->start) {
132132
/* Try to merge */

0 commit comments

Comments
 (0)