mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
global: Convert simple_strtoul() with hex to hextoul()
It is a pain to have to specify the value 16 in each call. Add a new hextoul() function and update the code to use it. Add a proper comment to simple_strtoul() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
031725f8cd
commit
7e5f460ec4
183 changed files with 692 additions and 659 deletions
|
@ -205,7 +205,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
|
|||
/* pre-set image_load_addr */
|
||||
s = env_get("loadaddr");
|
||||
if (s != NULL)
|
||||
image_load_addr = simple_strtoul(s, NULL, 16);
|
||||
image_load_addr = hextoul(s, NULL);
|
||||
|
||||
switch (argc) {
|
||||
case 1:
|
||||
|
@ -220,7 +220,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
|
|||
* form must be written in a format which can not be
|
||||
* mis-interpreted as a valid number.
|
||||
*/
|
||||
addr = simple_strtoul(argv[1], &end, 16);
|
||||
addr = hextoul(argv[1], &end);
|
||||
if (end == (argv[1] + strlen(argv[1]))) {
|
||||
image_load_addr = addr;
|
||||
/* refresh bootfile name from env */
|
||||
|
@ -234,7 +234,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
|
|||
break;
|
||||
|
||||
case 3:
|
||||
image_load_addr = simple_strtoul(argv[1], NULL, 16);
|
||||
image_load_addr = hextoul(argv[1], NULL);
|
||||
net_boot_file_name_explicit = true;
|
||||
copy_filename(net_boot_file_name, argv[2],
|
||||
sizeof(net_boot_file_name));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue