lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bba6e865-ff2e-4c01-b95d-3b1a9e6dc0da@redhat.com>
Date:   Wed, 9 Jun 2021 13:27:46 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Liu Xiang <liu.xiang@...ngsmart.com>, akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        liuxiang_1999@....com
Subject: Re: [PATCH] mm: compaction: remove duplicate !list_empty(&sublist)
 check

On 09.06.21 11:54, Liu Xiang wrote:
> The list_splice_tail(&sublist, freelist) also do
> !list_empty(&sublist) check, so remove the duplicate call.
> 
> Signed-off-by: Liu Xiang <liu.xiang@...ngsmart.com>
> ---
>   mm/compaction.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 84fde270a..5b1dc832f 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1297,8 +1297,7 @@ move_freelist_head(struct list_head *freelist, struct page *freepage)
>   
>   	if (!list_is_last(freelist, &freepage->lru)) {
>   		list_cut_before(&sublist, freelist, &freepage->lru);
> -		if (!list_empty(&sublist))
> -			list_splice_tail(&sublist, freelist);
> +		list_splice_tail(&sublist, freelist);
>   	}
>   }
>   
> @@ -1315,8 +1314,7 @@ move_freelist_tail(struct list_head *freelist, struct page *freepage)
>   
>   	if (!list_is_first(freelist, &freepage->lru)) {
>   		list_cut_position(&sublist, freelist, &freepage->lru);
> -		if (!list_empty(&sublist))
> -			list_splice_tail(&sublist, freelist);
> +		list_splice_tail(&sublist, freelist);
>   	}
>   }
>   
> 

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ