diff options
author | Simon Glass | 2021-07-24 09:03:29 -0600 |
---|---|---|
committer | Tom Rini | 2021-08-02 13:32:14 -0400 |
commit | 7e5f460ec457fe310156e399198a41eb0ce1e98c (patch) | |
tree | 7e89e4d15fcea2d2263c4b4af1be69905537ef42 /arch/x86 | |
parent | 031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff) |
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/zimage.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index cf4210cd4ba..9938c80a42b 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -405,17 +405,17 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, } if (s) - state.bzimage_addr = simple_strtoul(s, NULL, 16); + state.bzimage_addr = hextoul(s, NULL); if (argc >= 3) { /* argv[2] holds the size of the bzImage */ - state.bzimage_size = simple_strtoul(argv[2], NULL, 16); + state.bzimage_size = hextoul(argv[2], NULL); } if (argc >= 4) - state.initrd_addr = simple_strtoul(argv[3], NULL, 16); + state.initrd_addr = hextoul(argv[3], NULL); if (argc >= 5) - state.initrd_size = simple_strtoul(argv[4], NULL, 16); + state.initrd_size = hextoul(argv[4], NULL); if (argc >= 6) { /* * When the base_ptr is passed in, we assume that the image is @@ -428,7 +428,7 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, * load address and set bzimage_addr to 0 so we know that it * cannot be proceesed (or processed again). */ - state.base_ptr = (void *)simple_strtoul(argv[5], NULL, 16); + state.base_ptr = (void *)hextoul(argv[5], NULL); state.load_address = state.bzimage_addr; state.bzimage_addr = 0; } @@ -702,7 +702,7 @@ static int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc, struct boot_params *base_ptr = state.base_ptr; if (argc > 1) - base_ptr = (void *)simple_strtoul(argv[1], NULL, 16); + base_ptr = (void *)hextoul(argv[1], NULL); if (!base_ptr) { printf("No zboot setup_base\n"); return CMD_RET_FAILURE; @@ -749,7 +749,7 @@ int do_zboot_parent(struct cmd_tbl *cmdtp, int flag, int argc, if (argc > 1) { char *endp; - simple_strtoul(argv[1], &endp, 16); + hextoul(argv[1], &endp); /* * endp pointing to nul means that argv[1] was just a valid * number, so pass it along to the normal processing |