mm: remove struct page from get_shadow_from_swap_cache
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 2 Apr 2024 20:16:57 +0000 (21:16 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:40 +0000 (20:56 -0700)
We don't actually use any parts of struct page; all we do is check the
value of the pointer.  So give the pointer the appropriate name & type.

Link: https://lkml.kernel.org/r/20240402201659.918308-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swap_state.c

index 2deac23633cdd8ed74e69614b28b37a249b17eec..642c30d8376c601962185502bb17a5f5936d8ee2 100644 (file)
@@ -73,11 +73,11 @@ void *get_shadow_from_swap_cache(swp_entry_t entry)
 {
        struct address_space *address_space = swap_address_space(entry);
        pgoff_t idx = swp_offset(entry);
-       struct page *page;
+       void *shadow;
 
-       page = xa_load(&address_space->i_pages, idx);
-       if (xa_is_value(page))
-               return page;
+       shadow = xa_load(&address_space->i_pages, idx);
+       if (xa_is_value(shadow))
+               return shadow;
        return NULL;
 }