diff mbox series

[09/12] mm/swapfile.c: remove the unneeded checking

Message ID 20250205092721.9395-10-bhe@redhat.com (mailing list archive)
State New
Headers show
Series Tiny cleanup and improvements about SWAP code | expand

Commit Message

Baoquan He Feb. 5, 2025, 9:27 a.m. UTC
In free_swap_and_cache_nr(), invocation of get_swap_device() has done
the checking if it's a swap entry. So remove the redundant checking
here.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 mm/swapfile.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 78b7329ad2c7..2a25ff5f31c8 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1784,9 +1784,6 @@  void free_swap_and_cache_nr(swp_entry_t entry, int nr)
 	bool any_only_cache = false;
 	unsigned long offset;
 
-	if (non_swap_entry(entry))
-		return;
-
 	si = get_swap_device(entry);
 	if (!si)
 		return;