diff options
author | Simon Glass | 2019-12-28 10:45:02 -0700 |
---|---|---|
committer | Jagan Teki | 2020-01-24 23:06:49 +0530 |
commit | e7f0ec09a04d208b9cdfb095bacf5394d90f19f3 (patch) | |
tree | 31cfceb95976941c377a7322be8575153c63aa50 /cmd | |
parent | 657afb14a0a96bd00177652d5510b3d5fb0327d5 (diff) |
image: Rename load_addr, save_addr, save_size
These global variables are quite short and generic. In fact the same name
is more often used locally for struct members and function arguments.
Add a image_ prefix to make them easier to distinguish.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/bmp.c | 8 | ||||
-rw-r--r-- | cmd/booti.c | 4 | ||||
-rw-r--r-- | cmd/bootm.c | 5 | ||||
-rw-r--r-- | cmd/bootz.c | 4 | ||||
-rw-r--r-- | cmd/cramfs.c | 4 | ||||
-rw-r--r-- | cmd/disk.c | 2 | ||||
-rw-r--r-- | cmd/elf.c | 4 | ||||
-rw-r--r-- | cmd/jffs2.c | 4 | ||||
-rw-r--r-- | cmd/load.c | 6 | ||||
-rw-r--r-- | cmd/mvebu/bubt.c | 6 | ||||
-rw-r--r-- | cmd/nand.c | 2 | ||||
-rw-r--r-- | cmd/net.c | 12 | ||||
-rw-r--r-- | cmd/pxe_utils.c | 4 | ||||
-rw-r--r-- | cmd/reiser.c | 2 | ||||
-rw-r--r-- | cmd/source.c | 3 | ||||
-rw-r--r-- | cmd/ximg.c | 2 | ||||
-rw-r--r-- | cmd/zfs.c | 2 |
17 files changed, 39 insertions, 35 deletions
diff --git a/cmd/bmp.c b/cmd/bmp.c index d2a39f677fd..1e4c9720fea 100644 --- a/cmd/bmp.c +++ b/cmd/bmp.c @@ -95,8 +95,8 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[ ulong addr; switch (argc) { - case 1: /* use load_addr as default address */ - addr = load_addr; + case 1: /* use image_load_addr as default address */ + addr = image_load_addr; break; case 2: /* use argument */ addr = simple_strtoul(argv[1], NULL, 16); @@ -116,8 +116,8 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar splash_get_pos(&x, &y); switch (argc) { - case 1: /* use load_addr as default address */ - addr = load_addr; + case 1: /* use image_load_addr as default address */ + addr = image_load_addr; break; case 2: /* use argument */ addr = simple_strtoul(argv[1], NULL, 16); diff --git a/cmd/booti.c b/cmd/booti.c index d0671deb759..de5058236e0 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -30,9 +30,9 @@ static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc, /* Setup Linux kernel Image entry point */ if (!argc) { - ld = load_addr; + ld = image_load_addr; debug("* kernel: default image load address = 0x%08lx\n", - load_addr); + image_load_addr); } else { ld = simple_strtoul(argv[0], NULL, 16); debug("* kernel: cmdline image address = 0x%08lx\n", ld); diff --git a/cmd/bootm.c b/cmd/bootm.c index 62ee7c4b8a1..931d53f0c72 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -144,7 +144,8 @@ int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd) char *local_args[2]; local_args[0] = (char *)cmd; local_args[1] = NULL; - printf("Automatic boot of image at addr 0x%08lX ...\n", load_addr); + printf("Automatic boot of image at addr 0x%08lX ...\n", + image_load_addr); return do_bootm(cmdtp, 0, 1, local_args); } @@ -232,7 +233,7 @@ static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int rcode = 0; if (argc < 2) { - return image_info(load_addr); + return image_info(image_load_addr); } for (arg = 1; arg < argc; ++arg) { diff --git a/cmd/bootz.c b/cmd/bootz.c index 74be62c2c5e..7bfc491221a 100644 --- a/cmd/bootz.c +++ b/cmd/bootz.c @@ -33,9 +33,9 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc, /* Setup Linux kernel zImage entry point */ if (!argc) { - images->ep = load_addr; + images->ep = image_load_addr; debug("* kernel: default image load address = 0x%08lx\n", - load_addr); + image_load_addr); } else { images->ep = simple_strtoul(argv[0], NULL, 16); debug("* kernel: cmdline image address = 0x%08lx\n", diff --git a/cmd/cramfs.c b/cmd/cramfs.c index 2188910b2a7..1bc987528f0 100644 --- a/cmd/cramfs.c +++ b/cmd/cramfs.c @@ -97,7 +97,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename; int size; - ulong offset = load_addr; + ulong offset = image_load_addr; char *offset_virt; struct part_info part; @@ -127,7 +127,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (argc == 3) { offset = simple_strtoul(argv[1], NULL, 0); - load_addr = offset; + image_load_addr = offset; filename = argv[2]; } diff --git a/cmd/disk.c b/cmd/disk.c index 437c1753740..c57561b3cb7 100644 --- a/cmd/disk.c +++ b/cmd/disk.c @@ -124,7 +124,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc, flush_cache(addr, (cnt+1)*info.blksz); /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; return bootm_maybe_autostart(cmdtp, argv[0]); } diff --git a/cmd/elf.c b/cmd/elf.c index 32f12a72b9b..57736f997bf 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -294,7 +294,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Consume address */ argc--; argv++; } else - addr = load_addr; + addr = image_load_addr; if (!valid_elf_image(addr)) return 1; @@ -348,7 +348,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * If we don't know where the image is then we're done. */ if (argc < 2) - addr = load_addr; + addr = image_load_addr; else addr = simple_strtoul(argv[1], NULL, 16); diff --git a/cmd/jffs2.c b/cmd/jffs2.c index b47cd3d9893..672ed43b3f3 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -476,7 +476,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) char *filename; int size; struct part_info *part; - ulong offset = load_addr; + ulong offset = image_load_addr; /* pre-set Boot file name */ filename = env_get("bootfile"); @@ -488,7 +488,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (argc == 3) { offset = simple_strtoul(argv[1], NULL, 16); - load_addr = offset; + image_load_addr = offset; filename = argv[2]; } diff --git a/cmd/load.c b/cmd/load.c index 68ff3010b47..bed973ede91 100644 --- a/cmd/load.c +++ b/cmd/load.c @@ -109,7 +109,7 @@ static int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, rcode = 1; } else { printf("## Start Addr = 0x%08lX\n", addr); - load_addr = addr; + image_load_addr = addr; } #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE @@ -485,12 +485,12 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, addr = load_serial_bin(offset); if (addr == ~0) { - load_addr = 0; + image_load_addr = 0; printf("## Binary (kermit) download aborted\n"); rcode = 1; } else { printf("## Start Addr = 0x%08lX\n", addr); - load_addr = addr; + image_load_addr = addr; } } if (load_baudrate != current_baudrate) { diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index 84d2d531f0d..6c68620d147 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -423,8 +423,10 @@ static int is_usb_active(void) #ifdef CONFIG_CMD_NET static size_t tftp_read_file(const char *file_name) { - /* update global variable load_addr before tftp file from network */ - load_addr = get_load_addr(); + /* + * update global variable image_load_addr before tftp file from network + */ + image_load_addr = get_load_addr(); return net_loop(TFTPGET); } diff --git a/cmd/nand.c b/cmd/nand.c index 5bda69e819b..92089a73c17 100644 --- a/cmd/nand.c +++ b/cmd/nand.c @@ -925,7 +925,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, struct mtd_info *mtd, /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; return bootm_maybe_autostart(cmdtp, cmd); } diff --git a/cmd/net.c b/cmd/net.c index 237403977e8..6bce214e45a 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -186,10 +186,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, net_boot_file_name_explicit = false; - /* pre-set load_addr */ + /* pre-set image_load_addr */ s = env_get("loadaddr"); if (s != NULL) - load_addr = simple_strtoul(s, NULL, 16); + image_load_addr = simple_strtoul(s, NULL, 16); switch (argc) { case 1: @@ -206,7 +206,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, */ addr = simple_strtoul(argv[1], &end, 16); if (end == (argv[1] + strlen(argv[1]))) { - load_addr = addr; + image_load_addr = addr; /* refresh bootfile name from env */ copy_filename(net_boot_file_name, env_get("bootfile"), sizeof(net_boot_file_name)); @@ -218,7 +218,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, break; case 3: - load_addr = simple_strtoul(argv[1], NULL, 16); + image_load_addr = simple_strtoul(argv[1], NULL, 16); net_boot_file_name_explicit = true; copy_filename(net_boot_file_name, argv[2], sizeof(net_boot_file_name)); @@ -227,8 +227,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, #ifdef CONFIG_CMD_TFTPPUT case 4: - if (strict_strtoul(argv[1], 16, &save_addr) < 0 || - strict_strtoul(argv[2], 16, &save_size) < 0) { + if (strict_strtoul(argv[1], 16, &image_save_addr) < 0 || + strict_strtoul(argv[2], 16, &image_save_size) < 0) { printf("Invalid address/size\n"); return CMD_RET_USAGE; } diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c index a636346bb51..ff8b0dcd7b8 100644 --- a/cmd/pxe_utils.c +++ b/cmd/pxe_utils.c @@ -1310,9 +1310,9 @@ void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg) #ifdef CONFIG_CMD_BMP /* display BMP if available */ if (cfg->bmp) { - if (get_relfile(cmdtp, cfg->bmp, load_addr)) { + if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) { run_command("cls", 0); - bmp_display(load_addr, + bmp_display(image_load_addr, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER); } else { printf("Skipping background bmp %s for failure\n", diff --git a/cmd/reiser.c b/cmd/reiser.c index 7f51b927a47..598fab48b32 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -154,7 +154,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; printf ("\n%ld bytes read\n", filelen); env_set_hex("filesize", filelen); diff --git a/cmd/source.c b/cmd/source.c index 3a51ebf0b66..be1135014f8 100644 --- a/cmd/source.c +++ b/cmd/source.c @@ -172,7 +172,8 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) addr = CONFIG_SYS_LOAD_ADDR; debug ("* source: default load address = 0x%08lx\n", addr); #if defined(CONFIG_FIT) - } else if (fit_parse_subimage (argv[1], load_addr, &addr, &fit_uname)) { + } else if (fit_parse_subimage(argv[1], image_load_addr, &addr, + &fit_uname)) { debug ("* source: subimage '%s' from FIT image at 0x%08lx\n", fit_uname, addr); #endif diff --git a/cmd/ximg.c b/cmd/ximg.c index 22b2037a33f..dccd1143a7a 100644 --- a/cmd/ximg.c +++ b/cmd/ximg.c @@ -33,7 +33,7 @@ static int do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { - ulong addr = load_addr; + ulong addr = image_load_addr; ulong dest = 0; ulong data, len; int verify; diff --git a/cmd/zfs.c b/cmd/zfs.c index ed5402bb139..15331306356 100644 --- a/cmd/zfs.c +++ b/cmd/zfs.c @@ -112,7 +112,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] zfs_close(&zfile); /* Loading ok, update default load address */ - load_addr = addr; + image_load_addr = addr; printf("%llu bytes read\n", zfile.size); env_set_hex("filesize", zfile.size); |