From: Lu Hongfei Date: Fri, 9 Jun 2023 09:30:57 +0000 (+0800) Subject: mm/vmalloc: replace the ternary conditional operator with min() X-Git-Tag: v6.6.7~2549^2~144 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e4bc271110e0c58c010071a9bbf150f39851dac;p=platform%2Fkernel%2Flinux-starfive.git mm/vmalloc: replace the ternary conditional operator with min() It would be better to replace the traditional ternary conditional operator with min() in zero_iter Link: https://lkml.kernel.org/r/20230609093057.27777-1-luhongfei@vivo.com Signed-off-by: Lu Hongfei Reviewed-by: Lorenzo Stoakes Reviewed-by: David Hildenbrand Cc: Christoph Hellwig Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton --- diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 9d64a40..d07d014 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3562,7 +3562,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;