Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558048 > unrolled thread

[PATCH] arm64/mm: use phys_addr_t

Started by<miles.chen@mediatek.com>
First post2017-01-13 07:30 +0100
Last post2017-01-13 13:10 +0100
Articles 6 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] arm64/mm: use phys_addr_t <miles.chen@mediatek.com> - 2017-01-13 07:30 +0100
    Re: [PATCH] arm64/mm: use phys_addr_t Catalin Marinas <catalin.marinas@arm.com> - 2017-01-13 12:20 +0100
    Re: [PATCH] arm64/mm: use phys_addr_t Mark Rutland <mark.rutland@arm.com> - 2017-01-13 12:30 +0100
      Re: [PATCH] arm64/mm: use phys_addr_t Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2017-01-13 12:30 +0100
        Re: [PATCH] arm64/mm: use phys_addr_t Mark Rutland <mark.rutland@arm.com> - 2017-01-13 12:50 +0100
          Re: [PATCH] arm64/mm: use phys_addr_t Will Deacon <will.deacon@arm.com> - 2017-01-13 13:10 +0100

#1558048 — [PATCH] arm64/mm: use phys_addr_t

From<miles.chen@mediatek.com>
Date2017-01-13 07:30 +0100
Subject[PATCH] arm64/mm: use phys_addr_t
Message-ID<sZ3x7-5Sp-1@gated-at.bofh.it>
From: Miles Chen <miles.chen@mediatek.com>

Use phys_addr_t instead of unsigned long for the
return value of __pa(), make code easy to understand.

Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 17243e4..7eb7c21 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -359,8 +359,8 @@ static void create_mapping_late(phys_addr_t phys, unsigned long virt,
 
 static void __init __map_memblock(pgd_t *pgd, phys_addr_t start, phys_addr_t end)
 {
-	unsigned long kernel_start = __pa(_text);
-	unsigned long kernel_end = __pa(__init_begin);
+	phys_addr_t kernel_start = __pa(_text);
+	phys_addr_t kernel_end = __pa(__init_begin);
 
 	/*
 	 * Take care not to create a writable alias for the
-- 
1.9.1

[toc] | [next] | [standalone]


#1558237

FromCatalin Marinas <catalin.marinas@arm.com>
Date2017-01-13 12:20 +0100
Message-ID<sZ83L-ay-11@gated-at.bofh.it>
In reply to#1558048
On Fri, Jan 13, 2017 at 01:59:35PM +0800, miles.chen@mediatek.com wrote:
> From: Miles Chen <miles.chen@mediatek.com>
> 
> Use phys_addr_t instead of unsigned long for the
> return value of __pa(), make code easy to understand.
> 
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> ---
>  arch/arm64/mm/mmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index 17243e4..7eb7c21 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -359,8 +359,8 @@ static void create_mapping_late(phys_addr_t phys, unsigned long virt,
>  
>  static void __init __map_memblock(pgd_t *pgd, phys_addr_t start, phys_addr_t end)
>  {
> -	unsigned long kernel_start = __pa(_text);
> -	unsigned long kernel_end = __pa(__init_begin);
> +	phys_addr_t kernel_start = __pa(_text);
> +	phys_addr_t kernel_end = __pa(__init_begin);

Looks fine.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

[toc] | [prev] | [next] | [standalone]


#1558247

FromMark Rutland <mark.rutland@arm.com>
Date2017-01-13 12:30 +0100
Message-ID<sZ8ds-dR-11@gated-at.bofh.it>
In reply to#1558048
On Fri, Jan 13, 2017 at 01:59:35PM +0800, miles.chen@mediatek.com wrote:
> From: Miles Chen <miles.chen@mediatek.com>
> 
> Use phys_addr_t instead of unsigned long for the
> return value of __pa(), make code easy to understand.
> 
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>

This looks sensible to me. It's consistent with the types these
variables are compared against, and with the types of function
parameters these are passed as.

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

Thanks,
Mark.

> ---
>  arch/arm64/mm/mmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index 17243e4..7eb7c21 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -359,8 +359,8 @@ static void create_mapping_late(phys_addr_t phys, unsigned long virt,
>  
>  static void __init __map_memblock(pgd_t *pgd, phys_addr_t start, phys_addr_t end)
>  {
> -	unsigned long kernel_start = __pa(_text);
> -	unsigned long kernel_end = __pa(__init_begin);
> +	phys_addr_t kernel_start = __pa(_text);
> +	phys_addr_t kernel_end = __pa(__init_begin);
>  
>  	/*
>  	 * Take care not to create a writable alias for the
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [prev] | [next] | [standalone]


#1558248

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2017-01-13 12:30 +0100
Message-ID<sZ8ds-dR-17@gated-at.bofh.it>
In reply to#1558247
On 13 January 2017 at 11:22, Mark Rutland <mark.rutland@arm.com> wrote:
> On Fri, Jan 13, 2017 at 01:59:35PM +0800, miles.chen@mediatek.com wrote:
>> From: Miles Chen <miles.chen@mediatek.com>
>>
>> Use phys_addr_t instead of unsigned long for the
>> return value of __pa(), make code easy to understand.
>>
>> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
>
> This looks sensible to me. It's consistent with the types these
> variables are compared against, and with the types of function
> parameters these are passed as.
>

Indeed. But doesn't it clash with Laura's series?

> Acked-by: Mark Rutland <mark.rutland@arm.com>
>
> Thanks,
> Mark.
>
>> ---
>>  arch/arm64/mm/mmu.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
>> index 17243e4..7eb7c21 100644
>> --- a/arch/arm64/mm/mmu.c
>> +++ b/arch/arm64/mm/mmu.c
>> @@ -359,8 +359,8 @@ static void create_mapping_late(phys_addr_t phys, unsigned long virt,
>>
>>  static void __init __map_memblock(pgd_t *pgd, phys_addr_t start, phys_addr_t end)
>>  {
>> -     unsigned long kernel_start = __pa(_text);
>> -     unsigned long kernel_end = __pa(__init_begin);
>> +     phys_addr_t kernel_start = __pa(_text);
>> +     phys_addr_t kernel_end = __pa(__init_begin);
>>
>>       /*
>>        * Take care not to create a writable alias for the
>> --
>> 1.9.1
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [prev] | [next] | [standalone]


#1558271

FromMark Rutland <mark.rutland@arm.com>
Date2017-01-13 12:50 +0100
Message-ID<sZ8wN-kY-3@gated-at.bofh.it>
In reply to#1558248
On Fri, Jan 13, 2017 at 11:27:48AM +0000, Ard Biesheuvel wrote:
> On 13 January 2017 at 11:22, Mark Rutland <mark.rutland@arm.com> wrote:
> > On Fri, Jan 13, 2017 at 01:59:35PM +0800, miles.chen@mediatek.com wrote:
> >> From: Miles Chen <miles.chen@mediatek.com>
> >>
> >> Use phys_addr_t instead of unsigned long for the
> >> return value of __pa(), make code easy to understand.
> >>
> >> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> >
> > This looks sensible to me. It's consistent with the types these
> > variables are compared against, and with the types of function
> > parameters these are passed as.
> >
> 
> Indeed. But doesn't it clash with Laura's series?

Good point.

Yes, but only for the RHS of the assignment changing. This'll need to be
rebased atop of the arm64 for-next/core branch, or Catalin/Will might
fix it up when applying, perhaps?

Thanks,
Mark.

> > Acked-by: Mark Rutland <mark.rutland@arm.com>
> >
> > Thanks,
> > Mark.
> >
> >> ---
> >>  arch/arm64/mm/mmu.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> >> index 17243e4..7eb7c21 100644
> >> --- a/arch/arm64/mm/mmu.c
> >> +++ b/arch/arm64/mm/mmu.c
> >> @@ -359,8 +359,8 @@ static void create_mapping_late(phys_addr_t phys, unsigned long virt,
> >>
> >>  static void __init __map_memblock(pgd_t *pgd, phys_addr_t start, phys_addr_t end)
> >>  {
> >> -     unsigned long kernel_start = __pa(_text);
> >> -     unsigned long kernel_end = __pa(__init_begin);
> >> +     phys_addr_t kernel_start = __pa(_text);
> >> +     phys_addr_t kernel_end = __pa(__init_begin);
> >>
> >>       /*
> >>        * Take care not to create a writable alias for the
> >> --
> >> 1.9.1
> >>
> >>
> >> _______________________________________________
> >> linux-arm-kernel mailing list
> >> linux-arm-kernel@lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [prev] | [next] | [standalone]


#1558298

FromWill Deacon <will.deacon@arm.com>
Date2017-01-13 13:10 +0100
Message-ID<sZ8Q9-HA-9@gated-at.bofh.it>
In reply to#1558271
On Fri, Jan 13, 2017 at 11:45:54AM +0000, Mark Rutland wrote:
> On Fri, Jan 13, 2017 at 11:27:48AM +0000, Ard Biesheuvel wrote:
> > On 13 January 2017 at 11:22, Mark Rutland <mark.rutland@arm.com> wrote:
> > > On Fri, Jan 13, 2017 at 01:59:35PM +0800, miles.chen@mediatek.com wrote:
> > >> From: Miles Chen <miles.chen@mediatek.com>
> > >>
> > >> Use phys_addr_t instead of unsigned long for the
> > >> return value of __pa(), make code easy to understand.
> > >>
> > >> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> > >
> > > This looks sensible to me. It's consistent with the types these
> > > variables are compared against, and with the types of function
> > > parameters these are passed as.
> > >
> > 
> > Indeed. But doesn't it clash with Laura's series?
> 
> Good point.
> 
> Yes, but only for the RHS of the assignment changing. This'll need to be
> rebased atop of the arm64 for-next/core branch, or Catalin/Will might
> fix it up when applying, perhaps?

Yeah, it's dead easy for me to fix up.

Will

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web