Skip to contentSkip to conversation

riscv: image: save space on the magic number field

PATCH New Chester Lin 1 participant 2 messages Sep 6, 2019 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: image: save space on the magic number field

From: Chester Lin <[email protected]>

Change the symbol from "RISCV" to "RSCV" so the magic number can be 32-bit long, which is consistent with other architectures.

---
 arch/riscv/lib/image.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/riscv/lib/image.c +4 -4
index d063beb7df..e8a8cb7190 100644
@@ -14,8 +14,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* ASCII version of "RISCV" defined in Linux kernel */
-#define LINUX_RISCV_IMAGE_MAGIC 0x5643534952
+/* ASCII version of "RSCV" defined in Linux kernel */
+#define LINUX_RISCV_IMAGE_MAGIC 0x56435352
 
 struct linux_image_h {
 	uint32_t	code0;		/* Executable code */
@@ -25,8 +25,8 @@ struct linux_image_h {
 	uint64_t	res1;		/* reserved */
 	uint64_t	res2;		/* reserved */
 	uint64_t	res3;		/* reserved */
-	uint64_t	magic;		/* Magic number */
-	uint32_t	res4;		/* reserved */
+	uint64_t	res4;		/* reserved */
+	uint32_t	magic;		/* Magic number */
 	uint32_t	res5;		/* reserved */
 };
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 riscv: image: save space on the magic number field

Hi,

Chester Lin <[email protected]> 於 2019年9月6日 週五 下午3:28寫道:

Quoted 36 lines

Change the symbol from "RISCV" to "RSCV" so the magic number can be 32-bit long, which is consistent with other architectures.

---
 arch/riscv/lib/image.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/riscv/lib/image.c +4 -5
index d063beb7df..e8a8cb7190 100644
@@ -14,8 +14,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* ASCII version of "RISCV" defined in Linux kernel */
-#define LINUX_RISCV_IMAGE_MAGIC 0x5643534952
+/* ASCII version of "RSCV" defined in Linux kernel */
+#define LINUX_RISCV_IMAGE_MAGIC 0x56435352
 
 struct linux_image_h {
        uint32_t        code0;          /* Executable code */
@@ -25,8 +25,8 @@ struct linux_image_h {
        uint64_t        res1;           /* reserved */
        uint64_t        res2;           /* reserved */
        uint64_t        res3;           /* reserved */
-       uint64_t        magic;          /* Magic number */
-       uint32_t        res4;           /* reserved */
+       uint64_t        res4;           /* reserved */
+       uint32_t        magic;          /* Magic number */
        uint32_t        res5;           /* reserved */
 };
 
--
Quoted 2 lines

2.20.1

Sorry for sending this patch again by a personal email account because somehow I can't send an email to the mailing list by my company email. I always got rejected by a middle server.

Anyway, I have submitted a patch to the kernel mailing lists as well.

Here is a reference link:
https://lkml.org/lkml/2019/9/6/80

Regards,
Chester