Skip to contentSkip to conversation

arm64: mm: avoid name clash in __page_to_voff()

PATCH New Oleksandr Andrushchenko 2 participants 2 messages Jan 18, 2017 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mm: avoid name clash in __page_to_voff()

From: Oleksandr Andrushchenko <[email protected]>

The arm64 __page_to_voff() macro takes a parameter called 'page', and also refers to 'struct page'. Thus, if the value passed in is not called 'page', we'll refer to the wrong struct name (which might not exist).

Fixes 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")

---
Changes since initital:
* use better description.

 arch/arm64/include/asm/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/memory.h +1 -1
index bfe632808d77..90c39a662379 100644
@@ -222,7 +222,7 @@ static inline void *phys_to_virt(phys_addr_t x)
 #define _virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
 #else
 #define __virt_to_pgoff(kaddr)	(((u64)(kaddr) & ~PAGE_OFFSET) / PAGE_SIZE * sizeof(struct page))
-#define __page_to_voff(page)	(((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
+#define __page_to_voff(kaddr)	(((u64)(kaddr) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
 
 #define page_to_virt(page)	((void *)((__page_to_voff(page)) | PAGE_OFFSET))
 #define virt_to_page(vaddr)	((struct page *)((__virt_to_pgoff(vaddr)) | VMEMMAP_START))
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

PATCH 1/1 arm64: mm: avoid name clash in __page_to_voff()

Quoted 11 lines · Oleksandr Andrushchenko

From: Oleksandr Andrushchenko <[email protected]>

The arm64 __page_to_voff() macro takes a parameter called 'page', and also refers to 'struct page'. Thus, if the value passed in is not called 'page', we'll refer to the wrong struct name (which might not exist).

Fixes 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")

Queued for 4.10. Thanks.

Signature · 1 line
Catalin