diff options
author | Baoquan He <bhe@redhat.com> | 2022-10-25 11:11:45 +0800 |
---|---|---|
committer | Dennis Zhou <dennis@kernel.org> | 2022-11-07 22:57:53 -0800 |
commit | c1f6688d35d47ca11200789b000b3b20f5ecdbd9 (patch) | |
tree | c79b7479bde324cd5a90e2605f887c79a666d536 /mm/percpu.c | |
parent | 5a7d596a05dddd09c44ae462f881491cf87ed120 (diff) |
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: Baoquan He <bhe@redhat.com>
Acked-by: Dennis Zhou <dennis@kernel.org>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Diffstat (limited to 'mm/percpu.c')
-rw-r--r-- | mm/percpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index 26d8cd2ca323..841bb93aaae6 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -2143,9 +2143,9 @@ static void pcpu_reclaim_populated(void) * other accessor is the free path which only returns area back to the * allocator not touching the populated bitmap. */ - while (!list_empty(&pcpu_chunk_lists[pcpu_to_depopulate_slot])) { - chunk = list_first_entry(&pcpu_chunk_lists[pcpu_to_depopulate_slot], - struct pcpu_chunk, list); + while ((chunk = list_first_entry_or_null( + &pcpu_chunk_lists[pcpu_to_depopulate_slot], + struct pcpu_chunk, list))) { WARN_ON(chunk->immutable); /* |