diff mbox

[U-Boot,v3,1/2] lib/fdtdec: Fix fdt_addr_t and fdt_size_t typedef

Message ID 1438628525-4086-1-git-send-email-yorksun@freescale.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

York Sun Aug. 3, 2015, 7:02 p.m. UTC
fdt_addr_t is a physical address. It can be either 64-bit or 32-bit,
depending on the architecture. It should be phys_addr_t instead of
u64 or u32. Similarly, fdt_size_t is changed to phys_size_t.

Signed-off-by: York Sun <yorksun@freescale.com>
CC: Simon Glass <sjg@chromium.org>
---
Change log
 v3: Rebase code to latest master, split into two patches.
 v2: Rebase code to latest master, add change to fsl_dspi.c.

 include/fdtdec.h |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Simon Glass Aug. 9, 2015, 3:08 p.m. UTC | #1
On 3 August 2015 at 13:02, York Sun <yorksun@freescale.com> wrote:
> fdt_addr_t is a physical address. It can be either 64-bit or 32-bit,
> depending on the architecture. It should be phys_addr_t instead of
> u64 or u32. Similarly, fdt_size_t is changed to phys_size_t.
>
> Signed-off-by: York Sun <yorksun@freescale.com>
> CC: Simon Glass <sjg@chromium.org>
> ---
> Change log
>  v3: Rebase code to latest master, split into two patches.
>  v2: Rebase code to latest master, add change to fsl_dspi.c.
>
>  include/fdtdec.h |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 4b3f8d1..4dee0d8 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -21,15 +21,13 @@ 
  * A typedef for a physical address. Note that fdt data is always big
  * endian even on a litle endian machine.
  */
+typedef phys_addr_t fdt_addr_t;
+typedef phys_size_t fdt_size_t;
 #ifdef CONFIG_PHYS_64BIT
-typedef u64 fdt_addr_t;
-typedef u64 fdt_size_t;
 #define FDT_ADDR_T_NONE (-1ULL)
 #define fdt_addr_to_cpu(reg) be64_to_cpu(reg)
 #define fdt_size_to_cpu(reg) be64_to_cpu(reg)
 #else
-typedef u32 fdt_addr_t;
-typedef u32 fdt_size_t;
 #define FDT_ADDR_T_NONE (-1U)
 #define fdt_addr_to_cpu(reg) be32_to_cpu(reg)
 #define fdt_size_to_cpu(reg) be32_to_cpu(reg)