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>
diff --git a/cmd/zip.c b/cmd/zip.c
index 8ad3768..08afd62 100644
--- a/cmd/zip.c
+++ b/cmd/zip.c
@@ -16,12 +16,12 @@
switch (argc) {
case 5:
- dst_len = simple_strtoul(argv[4], NULL, 16);
+ dst_len = hextoul(argv[4], NULL);
/* fall through */
case 4:
- src = simple_strtoul(argv[1], NULL, 16);
- src_len = simple_strtoul(argv[2], NULL, 16);
- dst = simple_strtoul(argv[3], NULL, 16);
+ src = hextoul(argv[1], NULL);
+ src_len = hextoul(argv[2], NULL);
+ dst = hextoul(argv[3], NULL);
break;
default:
return cmd_usage(cmdtp);