diff mbox series

[2/4] mm/swapfile.c: tmp is always smaller than max

Message ID 20200419013921.14390-2-richard.weiyang@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/4] mm/swapfile.c: found_free could be represented by (tmp < max) | expand

Commit Message

Wei Yang April 19, 2020, 1:39 a.m. UTC
If tmp is bigger or equal to max, we would jump to new_cluster.

Return true directly.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/swapfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 654bad5173bc..3aae700f9931 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -647,7 +647,7 @@  static bool scan_swap_map_try_ssd_cluster(struct swap_info_struct *si,
 	cluster->next = tmp + 1;
 	*offset = tmp;
 	*scan_base = tmp;
-	return tmp < max;
+	return true;
 }
 
 static void __del_from_avail_list(struct swap_info_struct *p)