Skip to contentSkip to conversation

common: fdt_support: print hexadecimal numbers in debug

PATCH Superseded Sekhar Nori 2 participants 3 messages Dec 5, 2018 – Dec 6, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: fdt_support: print hexadecimal numbers in debug

We usually deal with hexadecimal addresses and sizes in device-tree. Its much easier if debug logs print hexadecimal values too.

---
 common/fdt_support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/fdt_support.c +2 -2
index 3440e42a257b..194bb41d1414 100644
@@ -1025,7 +1025,7 @@ static u64 of_bus_default_map(fdt32_t *addr, const fdt32_t *range,
 	s  = fdt_read_number(range + na + pna, ns);
 	da = fdt_read_number(addr, na);
 
-	debug("OF: default map, cp=%llu, s=%llu, da=%llu\n", cp, s, da);
+	debug("OF: default map, cp=0x%llx, s=0x%llx, da=0x%llx\n", cp, s, da);
 
 	if (da < cp || da >= (cp + s))
 		return OF_BAD_ADDR;
@@ -1080,7 +1080,7 @@ static u64 of_bus_isa_map(fdt32_t *addr, const fdt32_t *range,
 	s  = fdt_read_number(range + na + pna, ns);
 	da = fdt_read_number(addr + 1, na - 1);
 
-	debug("OF: ISA map, cp=%llu, s=%llu, da=%llu\n", cp, s, da);
+	debug("OF: ISA map, cp=0x%llx, s=0x%llx, da=0x%llx\n", cp, s, da);
 
 	if (da < cp || da >= (cp + s))
 		return OF_BAD_ADDR;
Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 common: fdt_support: print hexadecimal numbers in debug

Quoted 10 lines · Sekhar Nori

We usually deal with hexadecimal addresses and sizes in device-tree. Its much easier if debug logs print hexadecimal values too.

---
 common/fdt_support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

common/fdt_support.c static u64 of_bus_default_map(fdt32_t *addr, const fdt32_t *range, · line 1028

Quoted 10 lines
common/fdt_support.c +1 -1
index 3440e42a257b..194bb41d1414 100644
@@ -1025,7 +1025,7 @@ static u64 of_bus_default_map(fdt32_t *addr, const fdt32_t *range,
        s  = fdt_read_number(range + na + pna, ns);
        da = fdt_read_number(addr, na);
 
-       debug("OF: default map, cp=%llu, s=%llu, da=%llu\n", cp, s, da);
+       debug("OF: default map, cp=0x%llx, s=0x%llx, da=0x%llx\n", cp, s, da);

Note you probably don't need the 0x, since U-Boot uses hex by default. But if you do want it, you can use %#x.

Quoted 15 lines
common/fdt_support.c +1 -2
        if (da < cp || da >= (cp + s))
                return OF_BAD_ADDR;
@@ -1080,7 +1080,7 @@ static u64 of_bus_isa_map(fdt32_t *addr, const fdt32_t *range,
        s  = fdt_read_number(range + na + pna, ns);
        da = fdt_read_number(addr + 1, na - 1);
 
-       debug("OF: ISA map, cp=%llu, s=%llu, da=%llu\n", cp, s, da);
+       debug("OF: ISA map, cp=0x%llx, s=0x%llx, da=0x%llx\n", cp, s, da);
 
        if (da < cp || da >= (cp + s))
                return OF_BAD_ADDR;
--

2.16.2

#2 lore raw

PATCH 1/1 common: fdt_support: print hexadecimal numbers in debug

Quoted 23 lines · Simon Glass
Quoted 10 lines · Sekhar Nori

We usually deal with hexadecimal addresses and sizes in device-tree. Its much easier if debug logs print hexadecimal values too.

---
 common/fdt_support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 8 lines
common/fdt_support.c +0 -0
index 3440e42a257b..194bb41d1414 100644
@@ -1025,7 +1025,7 @@ static u64 of_bus_default_map(fdt32_t *addr, const fdt32_t *range,
        s  = fdt_read_number(range + na + pna, ns);
        da = fdt_read_number(addr, na);
 
Quoted 5 lines

common/fdt_support.c static u64 of_bus_default_map(fdt32_t *addr, const fdt32_t *range, · line 1028

Quoted 2 lines
common/fdt_support.c +1 -1
-       debug("OF: default map, cp=%llu, s=%llu, da=%llu\n", cp, s, da);
+       debug("OF: default map, cp=0x%llx, s=0x%llx, da=0x%llx\n", cp, s, da);

Note you probably don't need the 0x, since U-Boot uses hex by default. But if you do want it, you can use %#x.

Thanks for the tip! I chose to drop the 0x instead to remain consistent with rest of U-Boot. v2 posted.

Thanks,
Sekhar