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/board/varisys/common/sys_eeprom.c b/board/varisys/common/sys_eeprom.c
index 251d9fd..1bf5436 100644
--- a/board/varisys/common/sys_eeprom.c
+++ b/board/varisys/common/sys_eeprom.c
@@ -299,7 +299,7 @@
}
for (i = 0; *p && (i < 6); i++) {
- e.mac[index][i] = simple_strtoul(p, &p, 16);
+ e.mac[index][i] = hextoul(p, &p);
if (*p == ':')
p++;
}
@@ -364,7 +364,7 @@
set_date(argv[2]);
break;
case 'p': /* MAC table size */
- e.mac_count = simple_strtoul(argv[2], NULL, 16);
+ e.mac_count = hextoul(argv[2], NULL);
update_crc();
break;
case '0' ... '9': /* "mac 0" through "mac 22" */