diff mbox series

[v2] mm/vmalloc: Replace the ternary conditional operator with min()

Message ID 20230609093057.27777-1-luhongfei@vivo.com (mailing list archive)
State New
Headers show
Series [v2] mm/vmalloc: Replace the ternary conditional operator with min() | expand

Commit Message

Lu Hongfei June 9, 2023, 9:30 a.m. UTC
It would be better to replace the traditional ternary conditional
operator with min() in zero_iter

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
Reviewed-by: Lorenzo Stoakes <lstoakes@gmail.com>
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;