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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7e2144b1-23f3-68ec-b4b1-f4ed9025b476@redhat.com>
Date:   Mon, 12 Jun 2023 11:22:02 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Lu Hongfei <luhongfei@...o.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Uladzislau Rezki <urezki@...il.com>,
        Christoph Hellwig <hch@...radead.org>,
        Lorenzo Stoakes <lstoakes@...il.com>,
        "open list:VMALLOC" <linux-mm@...ck.org>,
        open list <linux-kernel@...r.kernel.org>
Cc:     opensource.kernel@...o.com
Subject: Re: [PATCH v2] mm/vmalloc: Replace the ternary conditional operator
 with min()

On 09.06.23 11:26, Lu Hongfei wrote:
> It would be better to replace the traditional ternary conditional
> operator with min() in zero_iter
> 
> Signed-off-by: Lu Hongfei <luhongfei@...o.com>
> Reviewed-by: Lorenzo Stoakes <lstoakes@...il.com>
> ---
>   mm/vmalloc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 29077d61ff81..6125ed506895
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -3571,7 +3571,7 @@ static size_t zero_iter(struct iov_iter *iter, size_t count)
>   	while (remains > 0) {
>   		size_t num, copied;
>   
> -		num = remains < PAGE_SIZE ? remains : PAGE_SIZE;
> +		num = min_t(size_t, remains, PAGE_SIZE);
>   		copied = copy_page_to_iter_nofault(ZERO_PAGE(0), 0, num, iter);
>   		remains -= copied;
>   

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

-- 
Cheers,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ