[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <832d7c69-ffd5-4764-8ffe-3a02bef0efb0@lucifer.local>
Date: Fri, 9 Jun 2023 08:09:45 +0100
From: Lorenzo Stoakes <lstoakes@...il.com>
To: Lu Hongfei <luhongfei@...o.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Uladzislau Rezki <urezki@...il.com>,
Christoph Hellwig <hch@...radead.org>,
"open list:VMALLOC" <linux-mm@...ck.org>,
open list <linux-kernel@...r.kernel.org>,
opensource.kernel@...o.com
Subject: Re: [PATCH] mm/vmalloc: Replace the ternary conditional operator
with min()
On Fri, Jun 09, 2023 at 02:13:09PM +0800, 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>
> ---
> mm/vmalloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 29077d61ff81..42df032e6c27
> --- 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(remains, PAGE_SIZE);
> copied = copy_page_to_iter_nofault(ZERO_PAGE(0), 0, num, iter);
> remains -= copied;
>
> --
> 2.39.0
>
Looks good to me, thanks,
Reviewed-by: Lorenzo Stoakes <lstoakes@...il.com>
Powered by blists - more mailing lists