linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] arm64: mm: avoid name clash in __page_to_voff()
@ 2017-01-18  7:09 Oleksandr Andrushchenko
  2017-01-18 11:24 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksandr Andrushchenko @ 2017-01-18  7:09 UTC (permalink / raw)
  To: linux-arm-kernel

From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>

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")
Acked-by: Mark Rutland <mark.rutland@arm.com>
Suggested-by: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
---
Changes since initital:
 * use better description.

 arch/arm64/include/asm/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index bfe632808d77..90c39a662379 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v1] arm64: mm: avoid name clash in __page_to_voff()
  2017-01-18  7:09 [PATCH v1] arm64: mm: avoid name clash in __page_to_voff() Oleksandr Andrushchenko
@ 2017-01-18 11:24 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2017-01-18 11:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 18, 2017 at 09:09:25AM +0200, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
> 
> 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")
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Suggested-by: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>

Queued for 4.10. Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-18 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18  7:09 [PATCH v1] arm64: mm: avoid name clash in __page_to_voff() Oleksandr Andrushchenko
2017-01-18 11:24 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).