Skip to contentSkip to conversation

arm64/mm: use phys_addr_t

PATCH In review [email protected] 5 participants 6 messages Jan 13, 2017 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64/mm: use phys_addr_t

From: Miles Chen <[email protected]>

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

---
 arch/arm64/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/mm/mmu.c +2 -2
index 17243e4..7eb7c21 100644
@@ -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
Signature · 1 line
1.9.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · miles.chen at mediatek.com

From: Miles Chen <[email protected]>

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

---
 arch/arm64/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/mm/mmu.c +0 -0
index 17243e4..7eb7c21 100644

arch/arm64/mm/mmu.c static void create_mapping_late(phys_addr_t phys, unsigned long virt, · line 363

Quoted 7 lines
arch/arm64/mm/mmu.c +2 -2
@@ -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.

reviewer Acked-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 6 lines · miles.chen at mediatek.com

From: Miles Chen <[email protected]>

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

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.

Thanks,
Mark.

Quoted 27 lines
---
 arch/arm64/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/mm/mmu.c +2 -2
index 17243e4..7eb7c21 100644
@@ -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
Signature · 7 lines
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw
Quoted 12 lines · Mark Rutland
Quoted 6 lines · miles.chen at mediatek.com

From: Miles Chen <[email protected]>

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

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?

Quoted 37 lines

Thanks,
Mark.

Quoted 23 lines
---
 arch/arm64/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/mm/mmu.c +2 -3
index 17243e4..7eb7c21 100644
@@ -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

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

reviewer
#4 lore raw
Quoted 7 lines · Ard Biesheuvel
Quoted 6 lines · Mark Rutland
Quoted 5 lines · miles.chen at mediatek.com

From: Miles Chen <[email protected]>

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

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

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.

Quoted 37 lines
Quoted 37 lines

Thanks,
Mark.

Quoted 23 lines
---
 arch/arm64/mm/mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/mm/mmu.c +2 -3
index 17243e4..7eb7c21 100644
@@ -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

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 15 lines · Mark Rutland
Quoted 14 lines · Ard Biesheuvel
Quoted 12 lines · Mark Rutland
Quoted 6 lines · miles.chen at mediatek.com

From: Miles Chen <[email protected]>

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

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.

Quoted 7 lines
Quoted 1 line

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