bootm: adjust the print format
PATCH 1/2 bootm: adjust the print format
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/bootm.c +1 -1
@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size);
Signature · 1 line
2.43.0
PATCH 2/2 cmd: booti: adjust the print format
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
---
cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/booti.c +1 -1
@@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi)/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , ld, +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , ld, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, (void *)ld, image_size); }
Signature · 1 line
2.43.0
Re: [PATCH 2/2] cmd: booti: adjust the print format
Hi Dario,
Quoted 26 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/booti.c +1
-2@@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi)/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , ld, +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , ld, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, (void *)ld, image_size); } --
Quoted 2 lines
2.43.0
I really don't like this...numbers are hex in U-Boot and this just adds confusion.
Regards,
Simon
Re: [PATCH 2/2] cmd: booti: adjust the print format
Hi Simon,
Quoted 23 lines · Simon Glass
Hi Dario,
Quoted 18 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/booti.c +0
-0@@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi)
Quoted 13 lines
Quoted 10 lines
cmd/booti.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , ld, +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , ld, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, (void *)ld, image_size); } --2.43.0
I really don't like this...numbers are hex in U-Boot and this just adds confusion.
Sorry, but I'm quite confused.
Doesn't printing 3 numbers in hexadecimal format with different formatting (two with 0x and
one without) create more confusion?
At least we should ensure formatting consistency. Also, it seems to me that this patch:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
has been considered correct.
Thanks and regards,
Dario
Quoted 3 lines
Regards,
Simon
Signature · 17 lines
Dario Binacchi Senior Embedded Linux Developer [email protected] __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 [email protected] www.amarulasolutions.com
Re: [PATCH 2/2] cmd: booti: adjust the print format
Hi Dario,
Quoted 50 lines · Dario Binacchi
Hi Simon,
Quoted 23 lines · Simon Glass
Hi Dario,
Quoted 18 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/booti.c +0
-0@@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi)Quoted 13 lines
Quoted 10 lines
cmd/booti.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , ld, +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , ld, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, (void *)ld, image_size); } --2.43.0
I really don't like this...numbers are hex in U-Boot and this just adds confusion.
Sorry, but I'm quite confused.
Doesn't printing 3 numbers in hexadecimal format with different formatting (two with0xand
one without) create more confusion?
At least we should ensure formatting consistency. Also, it seems to me that this patch:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
has been considered correct.
Quoted 1 line
Thanks and regards,
IMO we should avoid adding 0x to things...particularly for addresses. Better to remove it when it has crept in.
Regards,
SImon
Re: [PATCH 2/2] cmd: booti: adjust the print format
Quoted 54 lines · Simon Glass
Hi Dario,
Quoted 50 lines · Dario Binacchi
Hi Simon,
Quoted 23 lines · Simon Glass
Hi Dario,
Quoted 18 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/booti.c +0
-0@@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi)Quoted 13 lines
Quoted 10 lines
cmd/booti.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , ld, +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , ld, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, (void *)ld, image_size); } --2.43.0
I really don't like this...numbers are hex in U-Boot and this just adds confusion.
Sorry, but I'm quite confused.
Doesn't printing 3 numbers in hexadecimal format with different formatting (two with0xand
one without) create more confusion?
At least we should ensure formatting consistency. Also, it seems to me that this patch:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
has been considered correct.
Quoted 4 lines
Quoted 1 line
Thanks and regards,
IMO we should avoid adding 0x to things...particularly for addresses. Better to remove it when it has crept in.
That we don't prefix with "0x" like humans generally expect is why people have been confused why partition 10 is in fact not 10-in-decimal but 0x10.
Signature · 1 line
Tom
Re: [PATCH 2/2] cmd: booti: adjust the print format
Hi Tom,
Quoted 56 lines · Tom Rini
Quoted 54 lines · Simon Glass
Hi Dario,
Quoted 50 lines · Dario Binacchi
Hi Simon,
Quoted 23 lines · Simon Glass
Hi Dario,
Quoted 18 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)cmd/booti.c +0
-0@@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi)Quoted 13 lines
Quoted 10 lines
cmd/booti.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , ld, +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , ld, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, (void *)ld, image_size); } --2.43.0
I really don't like this...numbers are hex in U-Boot and this just adds confusion.
Sorry, but I'm quite confused.
Doesn't printing 3 numbers in hexadecimal format with different formatting (two with0xand
one without) create more confusion?
At least we should ensure formatting consistency. Also, it seems to me that this patch:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
has been considered correct.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Thanks and regards,
IMO we should avoid adding 0x to things...particularly for addresses. Better to remove it when it has crept in.
That we don't prefix with "0x" like humans generally expect is why people have been confused why partition 10 is in fact not 10-in-decimal but
0x10.
Yes, that's the one example which was in my head when reviewing this patch.
Regards,
Simon
Quoted 25 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/bootm.c +1
-2@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size); --
Quoted 2 lines
2.43.0
From U-Boot documentation, alpha-numeric input is assumed to be hexadecimal except when it is not, and generally does not accept "0x" prefix on input. So the correct action would be to make this consistent over the whole U-Boot code base, or remove the "0x" prefixes (not add more of them) ?
-E
Quoted 19 lines · E Shattow
Quoted 17 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/bootm.c +0
-0@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)
Quoted 16 lines
Quoted 10 lines
boot/bootm.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size); --2.43.0
From U-Boot documentation, alpha-numeric input is assumed to be
hexadecimal except when it is not, and generally does not accept "0x" prefix on input. So the correct action would be to make this consistent over the whole U-Boot code base, or remove the "0x" prefixes (not add more of them) ?
Most(?) U-Boot commands accept the 0x prefix. I don't think stripping it is sensible, I myself have gotten confused many times over hex values that lack the leading 0x in U-Boot output.
Maybe unavailable in SPL (not sure) but I prefer the "%#lx" format which prepends the 0x automatically.
Quoted 2 lines
-E
Signature · 1 line
// Caleb (they/them)
Tom Rini
Reviewed-byQuoted 22 lines · Caleb Connolly
Quoted 19 lines · E Shattow
Quoted 17 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/bootm.c +0
-0@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)
Quoted 14 lines
Quoted 11 lines
Quoted 10 lines
boot/bootm.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size); --2.43.0
Quoted 3 lines
From U-Boot documentation, alpha-numeric input is assumed to be
hexadecimal except when it is not, and generally does not accept "0x" prefix on input. So the correct action would be to make this
While there was some point in history where I'm sure we got confused by "0x" input I don't think that's true anymore (and everything should be using some strto function that works as expected, not a custom parser). So the docs should be updated there.
Quoted 9 lines
Quoted 2 lines
consistent over the whole U-Boot code base, or remove the "0x" prefixes (not add more of them) ?
Most(?) U-Boot commands accept the 0x prefix. I don't think stripping it is sensible, I myself have gotten confused many times over hex values that lack the leading 0x in U-Boot output.
Maybe unavailable in SPL (not sure) but I prefer the "%#lx" format which prepends the 0x automatically.
That we assume input is hex is just what it is these days. Output really ought to be prefixed with 0x because that's just common convention (and whatever we assumed people would Just Know 25+ years ago may not be true today). Since updating this output really shouldn't change our ABI, it's conceptually fine with me but we don't use "%#lx" a lot and so I don't know if tiny-printf handles it and so that might not be the right call for SPL code and so lets not change this patch.
Signature · 1 line
Tom
Hello Tom,
Quoted 62 lines · Tom Rini
Quoted 22 lines · Caleb Connolly
Quoted 19 lines · E Shattow
Quoted 17 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/bootm.c +0
-0@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)Quoted 14 lines
Quoted 11 lines
Quoted 10 lines
boot/bootm.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size); --2.43.0
Quoted 3 lines
From U-Boot documentation, alpha-numeric input is assumed to be
hexadecimal except when it is not, and generally does not accept "0x" prefix on input. So the correct action would be to make thisWhile there was some point in history where I'm sure we got confused by "0x" input I don't think that's true anymore (and everything should be using some strto function that works as expected, not a custom parser). So the docs should be updated there.
Quoted 9 lines
Quoted 2 lines
consistent over the whole U-Boot code base, or remove the "0x" prefixes (not add more of them) ?
Most(?) U-Boot commands accept the 0x prefix. I don't think stripping it is sensible, I myself have gotten confused many times over hex values that lack the leading 0x in U-Boot output.
Maybe unavailable in SPL (not sure) but I prefer the "%#lx" format which prepends the 0x automatically.
That we assume input is hex is just what it is these days. Output really ought to be prefixed with 0x because that's just common convention (and whatever we assumed people would Just Know 25+ years ago may not be true today). Since updating this output really shouldn't change our ABI, it's conceptually fine with me but we don't use "%#lx" a lot and so I don't know if tiny-printf handles it and so that might not be the right call for SPL code and so lets not change this patch.
Quoted 4 lines
Reviewed-by Tom Rini <[email protected]>--
Tom
Can this patch be merged?
I've seen both Review tags and conflicting opinions, and I haven't understood whether it can be accepted or not.
Thanks and regards,
Dario
Signature · 17 lines
Dario Binacchi Senior Embedded Linux Developer [email protected] __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 [email protected] www.amarulasolutions.com
Hi,
Quoted 20 lines · E Shattow
Quoted 17 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/bootm.c +0
-0@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)
Quoted 16 lines
Quoted 10 lines
boot/bootm.c +1
-2/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size); --2.43.0
From U-Boot documentation, alpha-numeric input is assumed to be hexadecimal except when it is not, and generally does not accept "0x" prefix on input. So the correct action would be to make this consistent over the whole U-Boot code base, or remove the "0x" prefixes (not add more of them) ?
Yes, we should avoid these prefixes as they can confuse people into thinking that hex is not the default.
In other cases where this is needed, for 0x you can use %#x
Regards,
Simon
Hi Dario,
Thank you for the patch.
Quoted 5 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Signed-off-by Dario Binacchi <[email protected]>
Quoted 20 lines
---
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/bootm.c +1
-1@@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress)/* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { -printf ("Moving Image from 0x%lx to 0x%lx, end=%lx\n" , +printf ("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n" , load, relocated_addr, relocated_addr + image_size);memmove ((void *)relocated_addr, load_buf, image_size);Signature · 1 line
2.43.0
Quoted 5 lines · Dario Binacchi
All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix.
Applied to u-boot/next, thanks!
Signature · 1 line
Tom