[PATCH] mm: Use local variable for swap address space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This addresses the following build error:
mm/huge_memory.c: In function ‘__split_huge_page’:
mm/huge_memory.c:2506:41: warning: dereferencing ‘void *’ pointer
    __xa_store(&swap_address_space(entry)->i_pages,
                                         ^~
mm/huge_memory.c:2506:41: error: request for member ‘i_pages’ in
something not a structure or union

Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Stuart Summers <stuart.summers@xxxxxxxxx>
---
 mm/huge_memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index affb2c3667f9..bced5485137b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2503,7 +2503,9 @@ static void __split_huge_page(struct page *page, struct list_head *list,
 					head + i, 0);
 		} else if (PageSwapCache(page)) {
 			swp_entry_t entry = { .val = page_private(head + i) };
-			__xa_store(&swap_address_space(entry)->i_pages,
+			struct address_space *address_space =
+				swap_address_space(entry);
+			__xa_store(&address_space->i_pages,
 				   swp_offset(entry),
 				   head + i, 0);
 		}
-- 
2.21.0.5.gaeb582a983

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux