From: Geliang Tang Date: Mon, 19 Dec 2016 15:03:11 +0000 (+0800) Subject: PM / Hibernate: Use rb_entry() instead of container_of() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=47087eeb744c83482774e8f6dc20cf2b11fff53f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 32e0c232efba..f80fd33639e0 100644 --- a/kernel/power/swap.c +++ b/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));