From: Baoquan He Date: Wed, 5 Feb 2025 09:27:18 +0000 (+0800) Subject: mm/swapfile.c: remove the unneeded checking X-Git-Tag: v6.15-rc1~81^2~370 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2d3268284ba4e254e4ca346bf6d63fb8a17518;p=thirdparty%2Flinux.git 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 Cc: Chris Li Cc: Kairui Song Signed-off-by: Andrew Morton --- diff --git a/mm/swapfile.c b/mm/swapfile.c index cbee03aa74b8e..45d25f1706608 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;