summaryrefslogtreecommitdiff
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
authorLu Hongfei <luhongfei@vivo.com>2023-06-09 17:30:57 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-06-19 16:19:11 -0700
commit0e4bc271110e0c58c010071a9bbf150f39851dac (patch)
tree055b096ffe3bcee4c12abb9309c80f94ed177c50 /mm/vmalloc.c
parente3b7bf972d632288ccad95b116628e3141be676e (diff)
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 <luhongfei@vivo.com> Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Uladzislau Rezki (Sony) <urezki@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 9d64a4098c36..d07d0140ebd3 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;