From 7e5f460ec457fe310156e399198a41eb0ce1e98c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 24 Jul 2021 09:03:29 -0600 Subject: 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 --- cmd/iotrace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd/iotrace.c') diff --git a/cmd/iotrace.c b/cmd/iotrace.c index 652ebefb89..f28359e287 100644 --- a/cmd/iotrace.c +++ b/cmd/iotrace.c @@ -60,8 +60,8 @@ static int do_set_buffer(int argc, char *const argv[]) ulong addr = 0, size = 0; if (argc == 2) { - addr = simple_strtoul(*argv++, NULL, 16); - size = simple_strtoul(*argv++, NULL, 16); + addr = hextoul(*argv++, NULL); + size = hextoul(*argv++, NULL); } else if (argc != 0) { return CMD_RET_USAGE; } @@ -76,8 +76,8 @@ static int do_set_region(int argc, char *const argv[]) ulong addr = 0, size = 0; if (argc == 2) { - addr = simple_strtoul(*argv++, NULL, 16); - size = simple_strtoul(*argv++, NULL, 16); + addr = hextoul(*argv++, NULL); + size = hextoul(*argv++, NULL); } else if (argc != 0) { return CMD_RET_USAGE; } -- cgit v1.2.3