diff options
author | Baoquan He <bhe@redhat.com> | 2025-02-05 17:27:18 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-03-16 22:06:07 -0700 |
commit | ac2d3268284ba4e254e4ca346bf6d63fb8a17518 (patch) | |
tree | adae3b58bcd6cde77f21c3184634f9a486de5c66 | |
parent | e89c45c700e7d9ab4913ec98f1fe9f23d46c1397 (diff) | |
download | linux-ac2d3268284ba4e254e4ca346bf6d63fb8a17518.tar.gz linux-ac2d3268284ba4e254e4ca346bf6d63fb8a17518.tar.bz2 linux-ac2d3268284ba4e254e4ca346bf6d63fb8a17518.zip |
mm/swapfile.c: remove the unneeded checking
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>
-rw-r--r-- | mm/swapfile.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index cbee03aa74b8..45d25f170660 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1789,9 +1789,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; |