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/drivers/net/phy/b53.c b/drivers/net/phy/b53.c
index 21da53c..695fac4 100644
--- a/drivers/net/phy/b53.c
+++ b/drivers/net/phy/b53.c
@@ -646,8 +646,8 @@
return ret;
}
- page = simple_strtoul(argv[1], NULL, 16);
- offset = simple_strtoul(argv[2], NULL, 16);
+ page = hextoul(argv[1], NULL);
+ offset = hextoul(argv[2], NULL);
width = simple_strtoul(argv[3], NULL, 10);
switch (width) {
@@ -698,13 +698,13 @@
return ret;
}
- page = simple_strtoul(argv[1], NULL, 16);
- offset = simple_strtoul(argv[2], NULL, 16);
+ page = hextoul(argv[1], NULL);
+ offset = hextoul(argv[2], NULL);
width = simple_strtoul(argv[3], NULL, 10);
if (width == 48 || width == 64)
value64 = simple_strtoull(argv[4], NULL, 16);
else
- value = simple_strtoul(argv[4], NULL, 16);
+ value = hextoul(argv[4], NULL);
switch (width) {
case 8: