[PATCH 2/3] cmd: adtimg: Rename internal symbols

Eugeniu Rosca roscaeugeniu at gmail.com
Tue Dec 24 17:51:07 CET 2019


With 'dtimg.c' renamed to 'adtimg.c', now ensure the naming
consistency in the internal implementation of 'adtimg.c'.

No functional change intended.

Cc: Sam Protsenko <semen.protsenko at linaro.org>
Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
---
 cmd/adtimg.c | 51 ++++++++++++++++++++++++++-------------------------
 1 file changed, 26 insertions(+), 25 deletions(-)

diff --git a/cmd/adtimg.c b/cmd/adtimg.c
index 6c5d53cc6808..22b4f5e1a83f 100644
--- a/cmd/adtimg.c
+++ b/cmd/adtimg.c
@@ -8,13 +8,13 @@
 #include <image-android-dt.h>
 #include <common.h>
 
-enum cmd_dtimg_info {
-	CMD_DTIMG_START = 0,
-	CMD_DTIMG_SIZE,
+enum cmd_adtimg_info {
+	CMD_ADTIMG_START = 0,
+	CMD_ADTIMG_SIZE,
 };
 
-static int do_dtimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
-			 char * const argv[])
+static int do_adtimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
+			  char * const argv[])
 {
 	char *endp;
 	ulong hdr_addr;
@@ -38,7 +38,8 @@ static int do_dtimg_dump(cmd_tbl_t *cmdtp, int flag, int argc,
 	return CMD_RET_SUCCESS;
 }
 
-static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
+static int adtimg_get_fdt(int argc, char * const argv[],
+			  enum cmd_adtimg_info cmd)
 {
 	ulong hdr_addr;
 	u32 index;
@@ -71,14 +72,14 @@ static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
 		return CMD_RET_FAILURE;
 
 	switch (cmd) {
-	case CMD_DTIMG_START:
+	case CMD_ADTIMG_START:
 		snprintf(buf, sizeof(buf), "%lx", fdt_addr);
 		break;
-	case CMD_DTIMG_SIZE:
+	case CMD_ADTIMG_SIZE:
 		snprintf(buf, sizeof(buf), "%x", fdt_size);
 		break;
 	default:
-		printf("Error: Unknown cmd_dtimg_info value: %d\n", cmd);
+		printf("Error: Unknown cmd_adtimg_info value: %d\n", cmd);
 		return CMD_RET_FAILURE;
 	}
 
@@ -87,31 +88,31 @@ static int dtimg_get_fdt(int argc, char * const argv[], enum cmd_dtimg_info cmd)
 	return CMD_RET_SUCCESS;
 }
 
-static int do_dtimg_start(cmd_tbl_t *cmdtp, int flag, int argc,
-			  char * const argv[])
+static int do_adtimg_start(cmd_tbl_t *cmdtp, int flag, int argc,
+			   char * const argv[])
 {
-	return dtimg_get_fdt(argc, argv, CMD_DTIMG_START);
+	return adtimg_get_fdt(argc, argv, CMD_ADTIMG_START);
 }
 
-static int do_dtimg_size(cmd_tbl_t *cmdtp, int flag, int argc,
-			 char * const argv[])
+static int do_adtimg_size(cmd_tbl_t *cmdtp, int flag, int argc,
+			  char * const argv[])
 {
-	return dtimg_get_fdt(argc, argv, CMD_DTIMG_SIZE);
+	return adtimg_get_fdt(argc, argv, CMD_ADTIMG_SIZE);
 }
 
-static cmd_tbl_t cmd_dtimg_sub[] = {
-	U_BOOT_CMD_MKENT(dump, 2, 0, do_dtimg_dump, "", ""),
-	U_BOOT_CMD_MKENT(start, 4, 0, do_dtimg_start, "", ""),
-	U_BOOT_CMD_MKENT(size, 4, 0, do_dtimg_size, "", ""),
+static cmd_tbl_t cmd_adtimg_sub[] = {
+	U_BOOT_CMD_MKENT(dump, 2, 0, do_adtimg_dump, "", ""),
+	U_BOOT_CMD_MKENT(start, 4, 0, do_adtimg_start, "", ""),
+	U_BOOT_CMD_MKENT(size, 4, 0, do_adtimg_size, "", ""),
 };
 
-static int do_dtimg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_adtimg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *cp;
 
-	cp = find_cmd_tbl(argv[1], cmd_dtimg_sub, ARRAY_SIZE(cmd_dtimg_sub));
+	cp = find_cmd_tbl(argv[1], cmd_adtimg_sub, ARRAY_SIZE(cmd_adtimg_sub));
 
-	/* Strip off leading 'dtimg' command argument */
+	/* Strip off leading 'adtimg' command argument */
 	argc--;
 	argv++;
 
@@ -124,17 +125,17 @@ static int do_dtimg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 
 U_BOOT_CMD(
-	dtimg, CONFIG_SYS_MAXARGS, 0, do_dtimg,
+	adtimg, CONFIG_SYS_MAXARGS, 0, do_adtimg,
 	"manipulate dtb/dtbo Android image",
 	"dump <addr>\n"
 	"    - parse specified image and print its structure info\n"
 	"      <addr>: image address in RAM, in hex\n"
-	"dtimg start <addr> <index> <varname>\n"
+	"adtimg start <addr> <index> <varname>\n"
 	"    - get address (hex) of FDT in the image, by index\n"
 	"      <addr>: image address in RAM, in hex\n"
 	"      <index>: index of desired FDT in the image\n"
 	"      <varname>: name of variable where to store address of FDT\n"
-	"dtimg size <addr> <index> <varname>\n"
+	"adtimg size <addr> <index> <varname>\n"
 	"    - get size (hex, bytes) of FDT in the image, by index\n"
 	"      <addr>: image address in RAM, in hex\n"
 	"      <index>: index of desired FDT in the image\n"
-- 
2.24.0



More information about the U-Boot mailing list