doc:fix typo in 'mmc write' example
PATCH 1/1 doc:fix typo in 'mmc write' example
In the 'mmc write' command example, it writes 16 blocks (0x10). But the output contains 256 (0x100) blocks. This patch fixes the mismatch.
--- doc/usage/cmd/mmc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
doc/usage/cmd/mmc.rst +1 -1
@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmc read/write' command: => mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 0x100 MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK The partition list can be shown via 'mmc part' command:
Signature · 1 line
2.40.0
Quoted 14 lines · Alexander Shirokov
In the 'mmc write' command example, it writes 16 blocks (
0x10). But the output contains 256 (0x100) blocks. This patch fixes the mismatch.Signed-off-by Alexander Shirokov <[email protected]>--- doc/usage/cmd/mmc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)doc/usage/cmd/mmc.rst +0
-0
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc read/write' command: · line 220
Quoted 6 lines
doc/usage/cmd/mmc.rst +1
-1@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmc read/write' command: => mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 0x100 MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK
Could we drop the 0x as well? Those are not needed and may confuse people.
Quoted 5 lines
doc/usage/cmd/mmc.rst +0
-1The partition list can be shown via 'mmc part' command: --2.40.0
Regards,
Simon
Hello Simon,
Thanks for your answer.Using 0x explicitly shows that we are working with HEX.
But without the prefix, it looks like a decimal number. And it's more confusing
when the number of blocks looks like a decimal but is interpreted as HEX.
Here is an example:
mmc write 0x40000000 0x5000 16
MMC write: dev # 1, block # 20480, count 22 ... 22 blocks written: OKThis looks better. If we know that all number is HEX by default
mmc write 40000000 5000 16
Do we have to use something like this?
Hi Shirokov,
Quoted 9 lines · Shirokov Alexander
Hello Simon,
Thanks for your answer.Using 0x explicitly shows that we are working with HEX. But without the prefix, it looks like a decimal number. And it's more confusing when the number of blocks looks like a decimal but is interpreted as HEX.
Here is an example:
Quoted 7 lines
mmc write 0x40000000 0x5000 16 MMC write: dev # 1, block # 20480, count 22 ... 22 blocks written: OKThis looks better. If we know that all number is HEX by default
mmc write 40000000 5000 16Do we have to use something like this?
The convention in U-Boot is to use hex, since it is a bootloader. So when you add 0x prefixes it confuses people into thinking that otherwise it would be decimal.
BTW we did discuss adding a decimal prefix but they did not get much support at the time.
Regards,
Simon
[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Quoted 30 lines
Hi Shirokov,
Quoted 4 lines · Shirokov Alexander
Hello Simon,
Thanks for your answer.Using 0x explicitly shows that we are working
with HEX.
Quoted 1 line
But without the prefix, it looks like a decimal number. And it's more
confusing
Quoted 11 lines
when the number of blocks looks like a decimal but is interpreted as HEX.
Here is an example:
mmc write 0x40000000 0x5000 16 MMC write: dev # 1, block # 20480, count 22 ... 22 blocks written: OKThis looks better. If we know that all number is HEX by default
mmc write 40000000 5000 16Do we have to use something like this?
The convention in U-Boot is to use hex, since it is a bootloader. So when you add 0x prefixes it confuses people into thinking that otherwise it would be decimal.
BTW we did discuss adding a decimal prefix but they did not get much support at the time.
Quoted 8 lines
Regards,
Simon[1]
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2]
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Thanks a lot, Simon
I prepared the patch without 0x prefix:
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Signature · 2 lines
Regards, Alexander
PATCH v2 1/1 cosmetic:fix typo in 'mmc write' example
In reply to Alexander ShirokovIn the 'mmc write' command example, it writes 16 blocks (0x10). But the output contains 256 (0x100) blocks. This patch fixes the mismatch.
--- doc/usage/cmd/mmc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
doc/usage/cmd/mmc.rst +1 -1
@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmc read/write' command: => mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 100 MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK The partition list can be shown via 'mmc part' command:
Signature · 1 line
2.40.0
Re: [PATCH v2] cosmetic:fix typo in 'mmc write' example
Hi Alexander,
Quoted 14 lines · Alexander Shirokov
In the 'mmc write' command example, it writes 16 blocks (
0x10). But the output contains 256 (0x100) blocks. This patch fixes the mismatch.Signed-off-by Alexander Shirokov <[email protected]>--- doc/usage/cmd/mmc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)doc/usage/cmd/mmc.rst +0
-0
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc read/write' command: · line 219
Quoted 5 lines
doc/usage/cmd/mmc.rst +1
-1@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmc read/write' command: => mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 100
Drop the other 0x things too?
Quoted 6 lines
doc/usage/cmd/mmc.rst +0
-1MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK The partition list can be shown via 'mmc part' command: --2.40.0
Regards,
Simon
Re: [PATCH v2] cosmetic:fix typo in 'mmc write' example
Quoted 10 lines · Simon Glass
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc
Quoted 3 lines
doc/usage/cmd/mmc.rst +0
-0@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmcread/write' command:
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc read/write' command: · line 219
Quoted 5 lines
doc/usage/cmd/mmc.rst +1
-1=> mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 100
Quoted 9 lines
Drop the other 0x things too?
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc · line 220
Quoted 1 line
doc/usage/cmd/mmc.rst +0
-0MMC write: dev # 0, block # 20480, count 256 ... 256 blockswritten: OK
Quoted 1 line
Regards,
Simon
Hi Simon,
Sure. I'll do that. But one clarification before. Should I change 0x only in "mmc write" line or change "mmc read" too, to keep the example consistent?
Signature · 2 lines
Regards, Alexander
Re: [PATCH v2] cosmetic:fix typo in 'mmc write' example
Quoted 18 lines · Shirokov Alexander
Quoted 16 lines · Simon Glass
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc
Quoted 3 lines
doc/usage/cmd/mmc.rst +0
-0@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmcread/write' command:
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc read/write' command: · line 219
Quoted 5 lines
doc/usage/cmd/mmc.rst +1
-1=> mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 100Drop the other 0x things too?
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc · line 220
Quoted 1 line
doc/usage/cmd/mmc.rst +0
-0MMC write: dev # 0, block # 20480, count 256 ... 256 blockswritten: OK
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Regards,
SimonHi Simon,
Sure. I'll do that. But one clarification before. Should I change 0x only in "mmc write" line or change "mmc read" too, to keep the example consistent?
Please, keep the document consistent. do_mmc_read() uses hextoul(). So it is safe to remove the 0x prefixes in the mmc read example too.
Best regards
Heinrich
Best regards
Heinrich
Re: [PATCH v2] cosmetic:fix typo in 'mmc write' example
Quoted 34 lines · Heinrich Schuchardt
Quoted 8 lines · Shirokov Alexander
Quoted 6 lines · Simon Glass
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc
Quoted 3 lines
doc/usage/cmd/mmc.rst +0
-0@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmcread/write' command:
Quoted 2 lines
doc/usage/cmd/mmc.rst +0
-0=> mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read:OK
Quoted 10 lines
Quoted 10 lines
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc read/write' command: · line 219
Quoted 3 lines
doc/usage/cmd/mmc.rst +1
-1- => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 100Drop the other 0x things too?
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc · line 219
Quoted 1 line
doc/usage/cmd/mmc.rst +0
-0MMC write: dev # 0, block # 20480, count 256 ... 256 blockswritten: OK
Quoted 1 line
Quoted 6 lines
Quoted 3 lines
Regards,
SimonHi Simon,
Sure. I'll do that. But one clarification before. Should I change 0xonly in
Quoted 1 line
"mmc write" line or change "mmc read" too, to keep the example
consistent?
Quoted 1 line
Please, keep the document consistent.
do_mmc_read()useshextoul(). So it is safe to remove the 0x prefixes in the mmc read example too.
Quoted 8 lines
Best regards
Heinrich
Best regards
Heinrich
Hello Heinrich,
Thank you for your response. The new version of the patch is here:
http://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Signature · 2 lines
Regards, Alexander
Re: [PATCH v2] cosmetic:fix typo in 'mmc write' example
In reply to Shirokov AlexanderHi Shirokov,
Quoted 19 lines · Shirokov Alexander
Quoted 16 lines · Simon Glass
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc
Quoted 3 lines
doc/usage/cmd/mmc.rst +0
-0@@ -216,7 +216,7 @@ The raw data can be read/written via 'mmcread/write' command:
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc read/write' command: · line 219
Quoted 5 lines
doc/usage/cmd/mmc.rst +1
-1=> mmc read 0x40000000 0x5000 0x100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 0x40000000 0x5000 100Drop the other 0x things too?
doc/usage/cmd/mmc.rst The raw data can be read/written via 'mmc · line 220
Quoted 1 line
doc/usage/cmd/mmc.rst +0
-0MMC write: dev # 0, block # 20480, count 256 ... 256 blockswritten: OK
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Regards,
SimonHi Simon,
Sure. I'll do that. But one clarification before. Should I change 0x only in "mmc write" line or change "mmc read" too, to keep the example consistent?
Well, you may as well do both. The best approach would be to send two patches, one which drops the 0x and the second which fixes the bug.
Regards,
Simon
PATCH v3 1/1 doc:mmc:drop 0x prefixes in read/write examples
In reply to Alexander ShirokovThe patch drops 0x prefixes because all numbers are interpreted as HEX by default.
Also, it fixes the mismatch between input arguments and output at 'mmc write' example. Now it's 256 (0x100) blocks.
--- doc/usage/cmd/mmc.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
doc/usage/cmd/mmc.rst +2 -2
@@ -213,10 +213,10 @@ The 'mmc info' command displays device's capabilities: The raw data can be read/written via 'mmc read/write' command: :: - => mmc read 0x40000000 0x5000 0x100 + => mmc read 40000000 5000 100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 40000000 5000 100 MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK The partition list can be shown via 'mmc part' command:
Signature · 1 line
2.40.1
Re: [PATCH v3] doc:mmc:drop 0x prefixes in read/write examples
Quoted 18 lines · Alexander Shirokov
The patch drops 0x prefixes because all numbers are interpreted as HEX by default.
Also, it fixes the mismatch between input arguments and output at 'mmc write' example. Now it's 256 (
0x100) blocks.Signed-off-by Alexander Shirokov <[email protected]>--- doc/usage/cmd/mmc.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)doc/usage/cmd/mmc.rst +0
-0@@ -213,10 +213,10 @@ The 'mmc info' command displays device's capabilities: The raw data can be read/written via 'mmc read/write' command: ::
doc/usage/cmd/mmc.rst The 'mmc info' command displays device's capabilities: · line 222
Quoted 10 lines
doc/usage/cmd/mmc.rst +2
-2- => mmc read 0x40000000 0x5000 0x100 + => mmc read 40000000 5000 100 MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK - => mmc write 0x40000000 0x5000 0x10 + => mmc write 40000000 5000 100 MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK The partition list can be shown via 'mmc part' command: