Selaa lähdekoodia

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: Geliang Tang <geliangtang@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Geliang Tang 8 vuotta sitten
vanhempi
commit
47087eeb74
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      kernel/power/swap.c

+ 1 - 1
kernel/power/swap.c

@@ -201,7 +201,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));