Commit c1f6688d authored by Baoquan He's avatar Baoquan He Committed by Dennis Zhou

mm/percpu: use list_first_entry_or_null in pcpu_reclaim_populated()

To replace list_empty()/list_first_entry() pair to simplify code.
Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
Acked-by: default avatarDennis Zhou <dennis@kernel.org>
Signed-off-by: default avatarDennis Zhou <dennis@kernel.org>
parent 5a7d596a
...@@ -2143,9 +2143,9 @@ static void pcpu_reclaim_populated(void) ...@@ -2143,9 +2143,9 @@ static void pcpu_reclaim_populated(void)
* other accessor is the free path which only returns area back to the * other accessor is the free path which only returns area back to the
* allocator not touching the populated bitmap. * allocator not touching the populated bitmap.
*/ */
while (!list_empty(&pcpu_chunk_lists[pcpu_to_depopulate_slot])) { while ((chunk = list_first_entry_or_null(
chunk = list_first_entry(&pcpu_chunk_lists[pcpu_to_depopulate_slot], &pcpu_chunk_lists[pcpu_to_depopulate_slot],
struct pcpu_chunk, list); struct pcpu_chunk, list))) {
WARN_ON(chunk->immutable); WARN_ON(chunk->immutable);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment