Re: [PATCH 2/8] mm/percpu: use list_first_entry_or_null in pcpu_reclaim_populated()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 24, 2022 at 04:14:29PM +0800, Baoquan He wrote:
> To replace list_empty()/list_first_entry() pair to simplify code.
> 
> Signed-off-by: Baoquan He <bhe@xxxxxxxxxx>
> ---
>  mm/percpu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index 26d8cd2ca323..a3fde4ac03a4 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);
>  
>  		/*
> -- 
> 2.34.1
> 

With added parenthesis,

Acked-by: Dennis Zhou <dennis@xxxxxxxxxx>

Thanks,
Dennis




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux