blob: 84cd3e83ab5f72d15e9424804ead78d99c810a18 [file] [log] [blame]
From: Baoquan He <bhe@redhat.com>
Subject: mm/swapfile.c: remove the unneeded checking
Date: Wed, 5 Feb 2025 17:27:18 +0800
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.
Link: https://lkml.kernel.org/r/20250205092721.9395-10-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <ryncsn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/swapfile.c | 3 ---
1 file changed, 3 deletions(-)
--- a/mm/swapfile.c~mm-swapfilec-remove-the-unneeded-checking
+++ a/mm/swapfile.c
@@ -1789,9 +1789,6 @@ void free_swap_and_cache_nr(swp_entry_t
bool any_only_cache = false;
unsigned long offset;
- if (non_swap_entry(entry))
- return;
-
si = get_swap_device(entry);
if (!si)
return;
_