diff options
author | Simon Glass <sjg@chromium.org> | 2019-12-28 10:45:02 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-17 14:02:35 -0500 |
commit | bb872dd930ccc0fb7a91c1b8e34b39ce2e9fed06 (patch) | |
tree | 583e177f483d60b15d54ed1b68240df39ea0d929 /net | |
parent | 9a3b4ceb37989263e9280644912d269386b99bb7 (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 'net')
-rw-r--r-- | net/net.c | 2 | ||||
-rw-r--r-- | net/nfs.c | 9 | ||||
-rw-r--r-- | net/tftp.c | 14 |
3 files changed, 13 insertions, 12 deletions
@@ -636,7 +636,7 @@ restart: printf("Bytes transferred = %d (%x hex)\n", net_boot_file_size, net_boot_file_size); env_set_hex("filesize", net_boot_file_size); - env_set_hex("fileaddr", load_addr); + env_set_hex("fileaddr", image_load_addr); } if (protocol != NETCONS) eth_halt(); @@ -88,14 +88,15 @@ static inline int store_block(uchar *src, unsigned offset, unsigned len) for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { /* start address in flash? */ - if (load_addr + offset >= flash_info[i].start[0]) { + if (image_load_addr + offset >= flash_info[i].start[0]) { rc = 1; break; } } if (rc) { /* Flash is destination for this packet */ - rc = flash_write((uchar *)src, (ulong)(load_addr+offset), len); + rc = flash_write((uchar *)src, (ulong)image_load_addr + offset, + len); if (rc) { flash_perror(rc); return -1; @@ -103,7 +104,7 @@ static inline int store_block(uchar *src, unsigned offset, unsigned len) } else #endif /* CONFIG_SYS_DIRECT_FLASH_NFS */ { - void *ptr = map_sysmem(load_addr + offset, len); + void *ptr = map_sysmem(image_load_addr + offset, len); memcpy(ptr, src, len); unmap_sysmem(ptr); @@ -912,7 +913,7 @@ void nfs_start(void) net_boot_file_expected_size_in_blocks << 9); print_size(net_boot_file_expected_size_in_blocks << 9, ""); } - printf("\nLoad address: 0x%lx\nLoading: *\b", load_addr); + printf("\nLoad address: 0x%lx\nLoading: *\b", image_load_addr); net_set_timeout_handler(nfs_timeout, nfs_timeout_handler); net_set_udp_handler(nfs_handler); diff --git a/net/tftp.c b/net/tftp.c index 1e3c18ae69..899d3b89d3 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -221,7 +221,7 @@ static int load_block(unsigned block, uchar *dst, unsigned len) ulong tosend = len; tosend = min(net_boot_file_size - offset, tosend); - (void)memcpy(dst, (void *)(save_addr + offset), tosend); + (void)memcpy(dst, (void *)(image_save_addr + offset), tosend); debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__, block, offset, len, tosend); return tosend; @@ -605,7 +605,7 @@ static void tftp_timeout_handler(void) } } -/* Initialize tftp_load_addr and tftp_load_size from load_addr and lmb */ +/* Initialize tftp_load_addr and tftp_load_size from image_load_addr and lmb */ static int tftp_init_load_addr(void) { #ifdef CONFIG_LMB @@ -614,13 +614,13 @@ static int tftp_init_load_addr(void) lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob); - max_size = lmb_get_free_size(&lmb, load_addr); + max_size = lmb_get_free_size(&lmb, image_load_addr); if (!max_size) return -1; tftp_load_size = max_size; #endif - tftp_load_addr = load_addr; + tftp_load_addr = image_load_addr; return 0; } @@ -710,9 +710,9 @@ void tftp_start(enum proto_t protocol) #ifdef CONFIG_CMD_TFTPPUT tftp_put_active = (protocol == TFTPPUT); if (tftp_put_active) { - printf("Save address: 0x%lx\n", save_addr); - printf("Save size: 0x%lx\n", save_size); - net_boot_file_size = save_size; + printf("Save address: 0x%lx\n", image_save_addr); + printf("Save size: 0x%lx\n", image_save_size); + net_boot_file_size = image_save_size; puts("Saving: *\b"); tftp_state = STATE_SEND_WRQ; new_transfer(); |