[PATCH 4/5] scripts: rockchip: rename NEWIDB_MAGIC to NEWIDB_MAGIC_RKNS

Michael Tretter m.tretter at pengutronix.de
Thu Jul 31 03:48:24 PDT 2025


There are different magic values for different image types. Include the
type of magic in the name of the magic.

Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
 scripts/rk-usb-loader.c | 4 ++--
 scripts/rkimage.c       | 2 +-
 scripts/rockchip.h      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
index 2e0d5488deb9853dce8fea929a63d97e5aac9828..87b5e3e3060579bc0473a15a9ef1f86c0ee2b720 100644
--- a/scripts/rk-usb-loader.c
+++ b/scripts/rk-usb-loader.c
@@ -222,9 +222,9 @@ static int upload_image(const char *filename)
 
 	hdr = buf;
 
-	if (hdr->magic != NEWIDB_MAGIC) {
+	if (hdr->magic != NEWIDB_MAGIC_RKNS) {
 		log_error("%s has invalid magic 0x%08x ( != 0x%08x )\n", filename,
-			  hdr->magic, NEWIDB_MAGIC);
+			  hdr->magic, NEWIDB_MAGIC_RKNS);
 		exit(1);
 	}
 
diff --git a/scripts/rkimage.c b/scripts/rkimage.c
index 39f9e44cceba2a9d961b014a6b1d24365f9327f9..4de6a380ee0565a896ed64eb5b2344db03657e05 100644
--- a/scripts/rkimage.c
+++ b/scripts/rkimage.c
@@ -74,7 +74,7 @@ static int create_newidb(struct newidb *idb)
 	int image_offset;
 	int i;
 
-	idb->magic = NEWIDB_MAGIC;
+	idb->magic = NEWIDB_MAGIC_RKNS;
 	idb->n_files = (n_code << 16) | (1 << 7) | (1 << 8);
 	idb->flags = 0;
 
diff --git a/scripts/rockchip.h b/scripts/rockchip.h
index 8033878b34d369c7e291f38fd2a4beaaf395556b..c4cedfa5669e59506b7c2c32d53bbdafec0e0dac 100644
--- a/scripts/rockchip.h
+++ b/scripts/rockchip.h
@@ -1,7 +1,7 @@
 #ifndef __ROCKCHIP_H
 #define __ROCKCHIP_H
 
-#define NEWIDB_MAGIC 0x534e4b52 /* 'RKNS' */
+#define NEWIDB_MAGIC_RKNS 0x534e4b52
 
 #define NEWIDB_FLAGS_SHA256	(1U << 0)
 #define NEWIDB_FLAGS_SHA512	(1U << 1)

-- 
2.39.5




More information about the barebox mailing list