diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 09:03:29 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 13:32:14 -0400 |
commit | 7e5f460ec457fe310156e399198a41eb0ce1e98c (patch) | |
tree | 7e89e4d15fcea2d2263c4b4af1be69905537ef42 /board/xilinx/zynq/cmds.c | |
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 'board/xilinx/zynq/cmds.c')
-rw-r--r-- | board/xilinx/zynq/cmds.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/board/xilinx/zynq/cmds.c b/board/xilinx/zynq/cmds.c index 6c697caa62..024fac65f3 100644 --- a/board/xilinx/zynq/cmds.c +++ b/board/xilinx/zynq/cmds.c @@ -422,7 +422,7 @@ static int do_zynq_rsa(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != cmdtp->maxargs) return CMD_RET_FAILURE; - src_ptr = simple_strtoul(argv[2], &endp, 16); + src_ptr = hextoul(argv[2], &endp); if (*argv[2] == 0 || *endp != 0) return CMD_RET_USAGE; @@ -453,26 +453,26 @@ static int zynq_decrypt_image(struct cmd_tbl *cmdtp, int flag, int argc, else return CMD_RET_USAGE; - srcaddr = simple_strtoul(argv[3], &endp, 16); + srcaddr = hextoul(argv[3], &endp); if (*argv[3] == 0 || *endp != 0) return CMD_RET_USAGE; - srclen = simple_strtoul(argv[4], &endp, 16); + srclen = hextoul(argv[4], &endp); if (*argv[4] == 0 || *endp != 0) return CMD_RET_USAGE; dstaddr = 0xFFFFFFFF; dstlen = srclen; } else { - srcaddr = simple_strtoul(argv[2], &endp, 16); + srcaddr = hextoul(argv[2], &endp); if (*argv[2] == 0 || *endp != 0) return CMD_RET_USAGE; - srclen = simple_strtoul(argv[3], &endp, 16); + srclen = hextoul(argv[3], &endp); if (*argv[3] == 0 || *endp != 0) return CMD_RET_USAGE; - dstaddr = simple_strtoul(argv[4], &endp, 16); + dstaddr = hextoul(argv[4], &endp); if (*argv[4] == 0 || *endp != 0) return CMD_RET_USAGE; - dstlen = simple_strtoul(argv[5], &endp, 16); + dstlen = hextoul(argv[5], &endp); if (*argv[5] == 0 || *endp != 0) return CMD_RET_USAGE; } |