diff options
author | Simon Glass <sjg@chromium.org> | 2019-12-28 10:45:02 -0700 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2020-01-24 23:06:49 +0530 |
commit | e7f0ec09a04d208b9cdfb095bacf5394d90f19f3 (patch) | |
tree | 31cfceb95976941c377a7322be8575153c63aa50 /common | |
parent | 657afb14a0a96bd00177652d5510b3d5fb0327d5 (diff) | |
download | u-boot-e7f0ec09a04d208b9cdfb095bacf5394d90f19f3.tar.gz |
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 'common')
-rw-r--r-- | common/board_r.c | 2 | ||||
-rw-r--r-- | common/image-fdt.c | 5 | ||||
-rw-r--r-- | common/image.c | 18 | ||||
-rw-r--r-- | common/spl/spl_net.c | 4 | ||||
-rw-r--r-- | common/update.c | 3 |
5 files changed, 16 insertions, 16 deletions
diff --git a/common/board_r.c b/common/board_r.c index 0102da7efd..cf3a5f7b73 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -484,7 +484,7 @@ static int initr_env(void) #endif /* Initialize from environment */ - load_addr = env_get_ulong("loadaddr", 16, load_addr); + image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr); return 0; } diff --git a/common/image-fdt.c b/common/image-fdt.c index 48388488d9..dbb1e6e131 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -285,7 +285,8 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, *of_flat_tree = NULL; *of_size = 0; - img_addr = (argc == 0) ? load_addr : simple_strtoul(argv[0], NULL, 16); + img_addr = (argc == 0) ? image_load_addr : + simple_strtoul(argv[0], NULL, 16); buf = map_sysmem(img_addr, 0); if (argc > 2) @@ -304,7 +305,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, else if (images->fit_uname_os) default_addr = (ulong)images->fit_hdr_os; else - default_addr = load_addr; + default_addr = image_load_addr; if (fit_parse_conf(select, default_addr, &fdt_addr, &fit_uname_config)) { diff --git a/common/image.c b/common/image.c index 75d5dd944f..2288cff126 100644 --- a/common/image.c +++ b/common/image.c @@ -557,9 +557,9 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch, /* Shared dual-format routines */ /*****************************************************************************/ #ifndef USE_HOSTCC -ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ -ulong save_addr; /* Default Save Address */ -ulong save_size; /* Default Save Size (in bytes) */ +ulong image_load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ +ulong image_save_addr; /* Default Save Address */ +ulong image_save_size; /* Default Save Size (in bytes) */ static int on_loadaddr(const char *name, const char *value, enum env_op op, int flags) @@ -567,7 +567,7 @@ static int on_loadaddr(const char *name, const char *value, enum env_op op, switch (op) { case env_op_create: case env_op_overwrite: - load_addr = simple_strtoul(value, NULL, 16); + image_load_addr = simple_strtoul(value, NULL, 16); break; default: break; @@ -936,15 +936,15 @@ ulong genimg_get_kernel_addr_fit(char * const img_addr, /* find out kernel image address */ if (!img_addr) { - kernel_addr = load_addr; + kernel_addr = image_load_addr; debug("* kernel: default image load address = 0x%08lx\n", - load_addr); + image_load_addr); #if CONFIG_IS_ENABLED(FIT) - } else if (fit_parse_conf(img_addr, load_addr, &kernel_addr, + } else if (fit_parse_conf(img_addr, image_load_addr, &kernel_addr, fit_uname_config)) { debug("* kernel: config '%s' from image at 0x%08lx\n", *fit_uname_config, kernel_addr); - } else if (fit_parse_subimage(img_addr, load_addr, &kernel_addr, + } else if (fit_parse_subimage(img_addr, image_load_addr, &kernel_addr, fit_uname_kernel)) { debug("* kernel: subimage '%s' from image at 0x%08lx\n", *fit_uname_kernel, kernel_addr); @@ -1102,7 +1102,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, if (images->fit_uname_os) default_addr = (ulong)images->fit_hdr_os; else - default_addr = load_addr; + default_addr = image_load_addr; if (fit_parse_conf(select, default_addr, &rd_addr, &fit_uname_config)) { diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c index 803303249c..30c050c0b3 100644 --- a/common/spl/spl_net.c +++ b/common/spl/spl_net.c @@ -19,14 +19,14 @@ static ulong spl_net_load_read(struct spl_load_info *load, ulong sector, { debug("%s: sector %lx, count %lx, buf %lx\n", __func__, sector, count, (ulong)buf); - memcpy(buf, (void *)(load_addr + sector), count); + memcpy(buf, (void *)(image_load_addr + sector), count); return count; } static int spl_net_load_image(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { - struct image_header *header = (struct image_header *)load_addr; + struct image_header *header = (struct image_header *)image_load_addr; int rv; env_init(); diff --git a/common/update.c b/common/update.c index 13b09ab00f..bfb760e52a 100644 --- a/common/update.c +++ b/common/update.c @@ -45,7 +45,6 @@ extern ulong tftp_timeout_ms; extern int tftp_timeout_count_max; -extern ulong load_addr; #ifdef CONFIG_MTD_NOR_FLASH extern flash_info_t flash_info[]; static uchar *saved_prot_info; @@ -72,7 +71,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr) env_set("netretry", "no"); /* download the update file */ - load_addr = addr; + image_load_addr = addr; copy_filename(net_boot_file_name, filename, sizeof(net_boot_file_name)); size = net_loop(TFTPGET); |