Skip to contentSkip to conversation

riscv-docs: correct the sequence of the magic number 2 since it's little endian

PATCH In review Chester Lin 3 participants 4 messages Sep 16, 2019 – Oct 3, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv-docs: correct the sequence of the magic number 2 since it's little endian

Correct the sequence of the magic number 2 since it's little endian.

---
 Documentation/riscv/boot-image-header.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/riscv/boot-image-header.txt +1 -1
index 14b1492f689b..f388805aa5c3 100644
@@ -18,7 +18,7 @@ The following 64-byte header is present in decompressed Linux kernel image.
 	u32 res1  = 0;		  /* Reserved */
 	u64 res2  = 0;    	  /* Reserved */
 	u64 magic = 0x5643534952; /* Magic number, little endian, "RISCV" */
-	u32 magic2 = 0x56534905;  /* Magic number 2, little endian, "RSC\x05" */
+	u32 magic2 = 0x05435352;  /* Magic number 2, little endian, "RSC\x05" */
 	u32 res4;		  /* Reserved for PE COFF offset */
 
 This header format is compliant with PE/COFF header and largely inspired from
Signature · 1 line
2.22.0
maintainer
#1 lore raw
Quoted 6 lines · On Mon, 16 Sep 2019 13:01:40 +0000 Chester Lin <[email protected]> wrote:

Correct the sequence of the magic number 2 since it's little endian.

---
 Documentation/riscv/boot-image-header.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

So I'm slowly digging my way through my docs folder, sorry for the delay.

Documentation/riscv/boot-image-header.txt The following 64-byte header is present in decompressed Linux kernel image. · line 21

Quoted 10 lines
Documentation/riscv/boot-image-header.txt +1 -1
index 14b1492f689b..f388805aa5c3 100644
@@ -18,7 +18,7 @@ The following 64-byte header is present in decompressed Linux kernel image.
 	u32 res1  = 0;		  /* Reserved */
 	u64 res2  = 0;    	  /* Reserved */
 	u64 magic = 0x5643534952; /* Magic number, little endian, "RISCV" */
-	u32 magic2 = 0x56534905;  /* Magic number 2, little endian, "RSC\x05" */
+	u32 magic2 = 0x05435352;  /* Magic number 2, little endian, "RSC\x05" */

That's doing more than just reordering the bytes. Was the original completely wrong? If so, the changelog should probably reflect that. Or else what am I missing?

Thanks,

jon

Reviewed-by
#2 lore raw

Hi Jon,

Quoted 12 lines · Jonathan Corbet
Quoted 6 lines · On Mon, 16 Sep 2019 13:01:40 +0000 Chester Lin <[email protected]> wrote:

Correct the sequence of the magic number 2 since it's little endian.

---
 Documentation/riscv/boot-image-header.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

So I'm slowly digging my way through my docs folder, sorry for the delay.

Quoted 14 lines

Documentation/riscv/boot-image-header.txt The following 64-byte header is present in decompressed Linux kernel image. · line 21

Quoted 10 lines
Documentation/riscv/boot-image-header.txt +1 -1
index 14b1492f689b..f388805aa5c3 100644
@@ -18,7 +18,7 @@ The following 64-byte header is present in decompressed Linux kernel image.
 	u32 res1  = 0;		  /* Reserved */
 	u64 res2  = 0;    	  /* Reserved */
 	u64 magic = 0x5643534952; /* Magic number, little endian, "RISCV" */
-	u32 magic2 = 0x56534905;  /* Magic number 2, little endian, "RSC\x05" */
+	u32 magic2 = 0x05435352;  /* Magic number 2, little endian, "RSC\x05" */

That's doing more than just reordering the bytes. Was the original completely wrong? If so, the changelog should probably reflect that. Or else what am I missing?

This was simply due to idiocy on my part, due to a very last-minute patch submission, where I missed that the original documented magic number was already in little-endian format. The updated number from Chester is correct.

So,

- Paul

maintainer
#3 lore raw
Quoted 8 lines · On Tue, 1 Oct 2019 11:35:11 -0700 (PDT) Paul Walmsley…

This was simply due to idiocy on my part, due to a very last-minute patch submission, where I missed that the original documented magic number was already in little-endian format. The updated number from Chester is correct.

So,

Great, patch applied, thanks.

jon

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv