diff mbox

[U-Boot] Change the visible output for transfers to display hex numbers

Message ID 1295950537-12363-1-git-send-email-holler@ahsoftware.de
State Rejected
Delegated to: Wolfgang Denk
Headers show

Commit Message

Alexander Holler Jan. 25, 2011, 10:15 a.m. UTC
When files were transfered the output is currently
-
Bytes transferred = 1976384 (1e2840 hex)
-
Using the decimal length as input for other commands conflicts with the
the default base of 16 needed.

Change the output to
-
Bytes transferred = 0x1e2840 (1976384 bytes)
-
to reflect what should be used as input for other commands.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 net/net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Wolfgang Denk Jan. 25, 2011, 10:27 a.m. UTC | #1
Dear Alexander Holler,

In message <1295950537-12363-1-git-send-email-holler@ahsoftware.de> you wrote:
> When files were transfered the output is currently
> -
> Bytes transferred = 1976384 (1e2840 hex)
> -
> Using the decimal length as input for other commands conflicts with the
> the default base of 16 needed.
> 
> Change the output to
> -
> Bytes transferred = 0x1e2840 (1976384 bytes)
> -
> to reflect what should be used as input for other commands.

In which way does this reflect what "should be used as input for other
commands"?

I don't even understand why you use this manually with copy & paste.

Why don't you simply refer to the ${filesize} variable?


In any case, if you want to change this format, you must change _all_
occurrences of it, i. e. include all the commands that load from
external storage (ide, usb, scsi, sata, nand, dataflash, SPI-Flash,
...).


Best regards,

Wolfgang Denk
Alexander Holler Jan. 25, 2011, 10:49 a.m. UTC | #2
Hello,

Am 25.01.2011 11:27, schrieb Wolfgang Denk:
> Dear Alexander Holler,
>
> In message<1295950537-12363-1-git-send-email-holler@ahsoftware.de>  you wrote:
>> When files were transfered the output is currently
>> -
>> Bytes transferred = 1976384 (1e2840 hex)
>> -
>> Using the decimal length as input for other commands conflicts with the
>> the default base of 16 needed.
>>
>> Change the output to
>> -
>> Bytes transferred = 0x1e2840 (1976384 bytes)
>> -
>> to reflect what should be used as input for other commands.
>
> In which way does this reflect what "should be used as input for other
> commands"?
>
> I don't even understand why you use this manually with copy&  paste.
>
> Why don't you simply refer to the ${filesize} variable?

TIMTOWTDI

> In any case, if you want to change this format, you must change _all_
> occurrences of it, i. e. include all the commands that load from
> external storage (ide, usb, scsi, sata, nand, dataflash, SPI-Flash,
> ...).

Than I prefer not to change something and live with that 
unorthogonality. Besides several READMEs, net/net.c is the only source where

git grep "Bytes transferred"

shows that such an output is used.

Regards,

Alexander
diff mbox

Patch

diff --git a/net/net.c b/net/net.c
index a609632..a454411 100644
--- a/net/net.c
+++ b/net/net.c
@@ -528,7 +528,7 @@  restart:
 		case NETLOOP_SUCCESS:
 			if (NetBootFileXferSize > 0) {
 				char buf[20];
-				printf("Bytes transferred = %ld (%lx hex)\n",
+				printf("Bytes transferred = 0x%lx (%ld bytes)\n",
 					NetBootFileXferSize,
 					NetBootFileXferSize);
 				sprintf(buf, "%lX", NetBootFileXferSize);