Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74e86642 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Alistair Delva
Browse files

UPSTREAM: arm64: avoid clang warning about self-assignment



(Upstream commit 366e37e4da23f9df498cc9577cadcb354f7bd431).

Building a preprocessed source file for arm64 now always produces
a warning with clang because of the page_to_virt() macro assigning
a variable to itself.

Adding a new temporary variable avoids this issue.

Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via pagealloc")
Reviewed-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Bug: 135692346
Change-Id: I5efe330c68219a32286e3afb6c69019650d51631
parent 651f77d3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -317,8 +317,9 @@ static inline void *phys_to_virt(phys_addr_t x)
#define page_to_virt(page)	({					\
	unsigned long __addr =						\
		((__page_to_voff(page)) | PAGE_OFFSET);			\
	__addr = __tag_set(__addr, page_kasan_tag(page));		\
	((void *)__addr);						\
	unsigned long __addr_tag =					\
		 __tag_set(__addr, page_kasan_tag(page));		\
	((void *)__addr_tag);						\
})

#define virt_to_page(vaddr)	((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START))