mm/swapfile.c: remove the unneeded checking
authorBaoquan He <bhe@redhat.com>
Wed, 5 Feb 2025 09:27:18 +0000 (17:27 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Mar 2025 05:06:07 +0000 (22:06 -0700)
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

index cbee03aa74b8eb2b24268032e6620cb9a6524727..45d25f17066084b685facb839daefcbed7a376de 100644 (file)
@@ -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;