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/e1000_spi.c b/drivers/net/e1000_spi.c
index 4fcc65d..69adf28 100644
--- a/drivers/net/e1000_spi.c
+++ b/drivers/net/e1000_spi.c
@@ -399,7 +399,7 @@
}
/* Parse the arguments */
- dest = (void *)simple_strtoul(argv[0], NULL, 16);
+ dest = (void *)hextoul(argv[0], NULL);
offset = simple_strtoul(argv[1], NULL, 0);
length = simple_strtoul(argv[2], NULL, 0);
@@ -444,7 +444,7 @@
}
/* Parse the arguments */
- source = (const void *)simple_strtoul(argv[0], NULL, 16);
+ source = (const void *)hextoul(argv[0], NULL);
offset = simple_strtoul(argv[1], NULL, 0);
length = simple_strtoul(argv[2], NULL, 0);