All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2016-10-21  8:58 ` Neeraj Upadhyay
  0 siblings, 0 replies; 16+ messages in thread
From: Neeraj Upadhyay @ 2016-10-21  8:58 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Ard Biesheuvel, Mark Rutland,
	James Morse, Laura Abbott, linux-arm-kernel, linux-kernel
  Cc: Neeraj Upadhyay

Fix parameter name for __page_to_voff, to match its definition.
At present, we don't see any issue, as page_to_virt's caller
declares 'page'.

Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
---
 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 ba62df8..b71086d 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -217,7 +217,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(kaddr)	(((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
+#define __page_to_voff(page)	(((u64)(page) & ~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))
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation

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

* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2016-10-21  8:58 ` Neeraj Upadhyay
  0 siblings, 0 replies; 16+ messages in thread
From: Neeraj Upadhyay @ 2016-10-21  8:58 UTC (permalink / raw)
  To: linux-arm-kernel

Fix parameter name for __page_to_voff, to match its definition.
At present, we don't see any issue, as page_to_virt's caller
declares 'page'.

Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
---
 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 ba62df8..b71086d 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -217,7 +217,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(kaddr)	(((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
+#define __page_to_voff(page)	(((u64)(page) & ~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))
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation

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

* Re: [PATCH] arm64: mm: fix __page_to_voff definition
  2016-10-21  8:58 ` Neeraj Upadhyay
@ 2016-10-21  9:45   ` Mark Rutland
  -1 siblings, 0 replies; 16+ messages in thread
From: Mark Rutland @ 2016-10-21  9:45 UTC (permalink / raw)
  To: Neeraj Upadhyay
  Cc: Catalin Marinas, Will Deacon, Ard Biesheuvel, James Morse,
	Laura Abbott, linux-arm-kernel, linux-kernel

On Fri, Oct 21, 2016 at 02:28:46PM +0530, Neeraj Upadhyay wrote:
> Fix parameter name for __page_to_voff, to match its definition.
> At present, we don't see any issue, as page_to_virt's caller
> declares 'page'.
> 
> Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

> ---
>  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 ba62df8..b71086d 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -217,7 +217,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(kaddr)	(((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
> +#define __page_to_voff(page)	(((u64)(page) & ~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))
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
> member of the Code Aurora Forum, hosted by The Linux Foundation
> 

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

* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2016-10-21  9:45   ` Mark Rutland
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Rutland @ 2016-10-21  9:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 21, 2016 at 02:28:46PM +0530, Neeraj Upadhyay wrote:
> Fix parameter name for __page_to_voff, to match its definition.
> At present, we don't see any issue, as page_to_virt's caller
> declares 'page'.
> 
> Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

> ---
>  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 ba62df8..b71086d 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -217,7 +217,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(kaddr)	(((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
> +#define __page_to_voff(page)	(((u64)(page) & ~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))
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
> member of the Code Aurora Forum, hosted by The Linux Foundation
> 

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

* Re: [PATCH] arm64: mm: fix __page_to_voff definition
  2016-10-21  8:58 ` Neeraj Upadhyay
@ 2016-10-21 10:18   ` Ard Biesheuvel
  -1 siblings, 0 replies; 16+ messages in thread
From: Ard Biesheuvel @ 2016-10-21 10:18 UTC (permalink / raw)
  To: Neeraj Upadhyay
  Cc: Catalin Marinas, Will Deacon, Mark Rutland, James Morse,
	Laura Abbott, linux-arm-kernel, linux-kernel

On 21 October 2016 at 09:58, Neeraj Upadhyay <neeraju@codeaurora.org> wrote:
> Fix parameter name for __page_to_voff, to match its definition.
> At present, we don't see any issue, as page_to_virt's caller
> declares 'page'.
>
> Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> ---
>  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 ba62df8..b71086d 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -217,7 +217,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(kaddr)  (((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
> +#define __page_to_voff(page)   (((u64)(page) & ~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))

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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

* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2016-10-21 10:18   ` Ard Biesheuvel
  0 siblings, 0 replies; 16+ messages in thread
From: Ard Biesheuvel @ 2016-10-21 10:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 21 October 2016 at 09:58, Neeraj Upadhyay <neeraju@codeaurora.org> wrote:
> Fix parameter name for __page_to_voff, to match its definition.
> At present, we don't see any issue, as page_to_virt's caller
> declares 'page'.
>
> Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> ---
>  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 ba62df8..b71086d 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -217,7 +217,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(kaddr)  (((u64)(page) & ~VMEMMAP_START) * PAGE_SIZE / sizeof(struct page))
> +#define __page_to_voff(page)   (((u64)(page) & ~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))

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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

* Re: [PATCH] arm64: mm: fix __page_to_voff definition
  2016-10-21  8:58 ` Neeraj Upadhyay
@ 2016-10-30 14:38   ` Catalin Marinas
  -1 siblings, 0 replies; 16+ messages in thread
From: Catalin Marinas @ 2016-10-30 14:38 UTC (permalink / raw)
  To: Neeraj Upadhyay
  Cc: Will Deacon, Ard Biesheuvel, Mark Rutland, James Morse,
	Laura Abbott, linux-arm-kernel, linux-kernel

On Fri, Oct 21, 2016 at 02:28:46PM +0530, Neeraj Upadhyay wrote:
> Fix parameter name for __page_to_voff, to match its definition.
> At present, we don't see any issue, as page_to_virt's caller
> declares 'page'.
> 
> Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>

I'll queue this patch for 4.10. Thanks.

-- 
Catalin

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

* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2016-10-30 14:38   ` Catalin Marinas
  0 siblings, 0 replies; 16+ messages in thread
From: Catalin Marinas @ 2016-10-30 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 21, 2016 at 02:28:46PM +0530, Neeraj Upadhyay wrote:
> Fix parameter name for __page_to_voff, to match its definition.
> At present, we don't see any issue, as page_to_virt's caller
> declares 'page'.
> 
> Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>

I'll queue this patch for 4.10. Thanks.

-- 
Catalin

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

* Re: [PATCH] arm64: mm: fix __page_to_voff definition
  2016-10-30 14:38   ` Catalin Marinas
@ 2016-10-31 15:32     ` Catalin Marinas
  -1 siblings, 0 replies; 16+ messages in thread
From: Catalin Marinas @ 2016-10-31 15:32 UTC (permalink / raw)
  To: Neeraj Upadhyay
  Cc: Mark Rutland, Ard Biesheuvel, Will Deacon, linux-kernel,
	James Morse, Laura Abbott, linux-arm-kernel

On Sun, Oct 30, 2016 at 02:38:58PM +0000, Catalin Marinas wrote:
> On Fri, Oct 21, 2016 at 02:28:46PM +0530, Neeraj Upadhyay wrote:
> > Fix parameter name for __page_to_voff, to match its definition.
> > At present, we don't see any issue, as page_to_virt's caller
> > declares 'page'.
> > 
> > Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> > Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> 
> I'll queue this patch for 4.10. Thanks.

I didn't realise that Will sent it already for 4.9-rc3, so I dropped it
from the 4.10 queue.

-- 
Catalin

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

* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2016-10-31 15:32     ` Catalin Marinas
  0 siblings, 0 replies; 16+ messages in thread
From: Catalin Marinas @ 2016-10-31 15:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Oct 30, 2016 at 02:38:58PM +0000, Catalin Marinas wrote:
> On Fri, Oct 21, 2016 at 02:28:46PM +0530, Neeraj Upadhyay wrote:
> > Fix parameter name for __page_to_voff, to match its definition.
> > At present, we don't see any issue, as page_to_virt's caller
> > declares 'page'.
> > 
> > Fixes: 9f2875912dac ("arm64: mm: restrict virt_to_page() to the linear mapping")
> > Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> 
> I'll queue this patch for 4.10. Thanks.

I didn't realise that Will sent it already for 4.9-rc3, so I dropped it
from the 4.10 queue.

-- 
Catalin

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

* [PATCH] arm64: mm: fix __page_to_voff definition
  2017-01-17 18:15       ` Oleksandr Andrushchenko
@ 2017-01-17 18:38         ` Mark Rutland
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Rutland @ 2017-01-17 18:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 17, 2017 at 08:15:36PM +0200, Oleksandr Andrushchenko wrote:
> Do you also want "Fixes: 3fa72fe9c614 ("arm64: mm: fix
> __page_to_voff definition")"

>From a look at the git history, that Fixes tag looks correct, so yes
please.

Thanks,
Mark.

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

* [PATCH] arm64: mm: fix __page_to_voff definition
  2017-01-17 17:19     ` Mark Rutland
@ 2017-01-17 18:15       ` Oleksandr Andrushchenko
  2017-01-17 18:38         ` Mark Rutland
  0 siblings, 1 reply; 16+ messages in thread
From: Oleksandr Andrushchenko @ 2017-01-17 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/17/2017 07:19 PM, Mark Rutland wrote:
> On Tue, Jan 17, 2017 at 07:13:45PM +0200, Oleksandr Andrushchenko wrote:
>> On 01/17/2017 06:15 PM, Mark Rutland wrote:
>>> On Tue, Jan 17, 2017 at 05:23:53PM +0200, Oleksandr Andrushchenko wrote:
>>>> From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
>>>>
>>>> Fix parameter name for __page_to_voff, to match its definition.
>>>> There are other callers of page_to_virt which do not
>>>> declare 'page'.
>>>>
>>>> Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
>>>> Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
>>> I take it this is because it messes up the 'struct page' at the end of
>>> the macro expansion?
>> yes, you got it right
>>> It would be good to explicitly state that, since that's not immediately
>>> obvious.
>> Will do that in patch v1
>>> With that:
>>>
>>> Acked-by: Mark Rutland <mark.rutland@arm.com>
>> Can I put your ack into the v1?
> Yes, with the updated commit message and title, you can add my ack.
>
> W.r.t. wording, I'd recommend:
>
>    arm64: mm: avoid name clash in __page_to_voff()
>
>    The arm64 __page_to_voff() macro taks 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).
>
>    Rename the parameter so that it doesn't clash.
Great, thanks
Do you also want "Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff 
definition")"
line or it is good without it?
> Thanks,
> Mark.
>
>>> Thanks,
>>> Mark.
>> Thanks,
>> Oleksandr
>>>> ---
>>>>   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
>>>>
>>>>
>>>> _______________________________________________
>>>> linux-arm-kernel mailing list
>>>> linux-arm-kernel at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] arm64: mm: fix __page_to_voff definition
  2017-01-17 17:13   ` Oleksandr Andrushchenko
@ 2017-01-17 17:19     ` Mark Rutland
  2017-01-17 18:15       ` Oleksandr Andrushchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Rutland @ 2017-01-17 17:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 17, 2017 at 07:13:45PM +0200, Oleksandr Andrushchenko wrote:
> On 01/17/2017 06:15 PM, Mark Rutland wrote:
> >On Tue, Jan 17, 2017 at 05:23:53PM +0200, Oleksandr Andrushchenko wrote:
> >>From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
> >>
> >>Fix parameter name for __page_to_voff, to match its definition.
> >>There are other callers of page_to_virt which do not
> >>declare 'page'.
> >>
> >>Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
> >>Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
> >I take it this is because it messes up the 'struct page' at the end of
> >the macro expansion?
> yes, you got it right
> >It would be good to explicitly state that, since that's not immediately
> >obvious.
> Will do that in patch v1
> >
> >With that:
> >
> >Acked-by: Mark Rutland <mark.rutland@arm.com>
> Can I put your ack into the v1?

Yes, with the updated commit message and title, you can add my ack.

W.r.t. wording, I'd recommend:

  arm64: mm: avoid name clash in __page_to_voff()

  The arm64 __page_to_voff() macro taks 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).

  Rename the parameter so that it doesn't clash.

Thanks,
Mark.

> >
> >Thanks,
> >Mark.
> Thanks,
> Oleksandr
> >>---
> >>  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
> >>
> >>
> >>_______________________________________________
> >>linux-arm-kernel mailing list
> >>linux-arm-kernel at lists.infradead.org
> >>http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* [PATCH] arm64: mm: fix __page_to_voff definition
  2017-01-17 16:15 ` Mark Rutland
@ 2017-01-17 17:13   ` Oleksandr Andrushchenko
  2017-01-17 17:19     ` Mark Rutland
  0 siblings, 1 reply; 16+ messages in thread
From: Oleksandr Andrushchenko @ 2017-01-17 17:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/17/2017 06:15 PM, Mark Rutland wrote:
> On Tue, Jan 17, 2017 at 05:23:53PM +0200, Oleksandr Andrushchenko wrote:
>> From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
>>
>> Fix parameter name for __page_to_voff, to match its definition.
>> There are other callers of page_to_virt which do not
>> declare 'page'.
>>
>> Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
>> Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
> I take it this is because it messes up the 'struct page' at the end of
> the macro expansion?
yes, you got it right
> It would be good to explicitly state that, since that's not immediately
> obvious.
Will do that in patch v1
>
> With that:
>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
Can I put your ack into the v1?
>
> Thanks,
> Mark.
Thanks,
Oleksandr
>> ---
>>   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
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] arm64: mm: fix __page_to_voff definition
  2017-01-17 15:23 Oleksandr Andrushchenko
@ 2017-01-17 16:15 ` Mark Rutland
  2017-01-17 17:13   ` Oleksandr Andrushchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Rutland @ 2017-01-17 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 17, 2017 at 05:23:53PM +0200, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
> 
> Fix parameter name for __page_to_voff, to match its definition.
> There are other callers of page_to_virt which do not
> declare 'page'.
> 
> Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
> Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>

I take it this is because it messes up the 'struct page' at the end of
the macro expansion?

It would be good to explicitly state that, since that's not immediately
obvious.

With that:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

> ---
>  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
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] arm64: mm: fix __page_to_voff definition
@ 2017-01-17 15:23 Oleksandr Andrushchenko
  2017-01-17 16:15 ` Mark Rutland
  0 siblings, 1 reply; 16+ messages in thread
From: Oleksandr Andrushchenko @ 2017-01-17 15:23 UTC (permalink / raw)
  To: linux-arm-kernel

From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>

Fix parameter name for __page_to_voff, to match its definition.
There are other callers of page_to_virt which do not
declare 'page'.

Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
Signed-off-by: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
---
 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] 16+ messages in thread

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

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  8:58 [PATCH] arm64: mm: fix __page_to_voff definition Neeraj Upadhyay
2016-10-21  8:58 ` Neeraj Upadhyay
2016-10-21  9:45 ` Mark Rutland
2016-10-21  9:45   ` Mark Rutland
2016-10-21 10:18 ` Ard Biesheuvel
2016-10-21 10:18   ` Ard Biesheuvel
2016-10-30 14:38 ` Catalin Marinas
2016-10-30 14:38   ` Catalin Marinas
2016-10-31 15:32   ` Catalin Marinas
2016-10-31 15:32     ` Catalin Marinas
2017-01-17 15:23 Oleksandr Andrushchenko
2017-01-17 16:15 ` Mark Rutland
2017-01-17 17:13   ` Oleksandr Andrushchenko
2017-01-17 17:19     ` Mark Rutland
2017-01-17 18:15       ` Oleksandr Andrushchenko
2017-01-17 18:38         ` Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.