aboutsummaryrefslogtreecommitdiff
path: root/cmd/mfsl.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:29 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /cmd/mfsl.c
parent031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff)
downloadu-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.zip
u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.gz
u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.bz2
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>
Diffstat (limited to 'cmd/mfsl.c')
-rw-r--r--cmd/mfsl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/mfsl.c b/cmd/mfsl.c
index 31f5b36..0c78720 100644
--- a/cmd/mfsl.c
+++ b/cmd/mfsl.c
@@ -23,8 +23,8 @@ int do_frd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (argc < 2)
return CMD_RET_USAGE;
- fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
- blocking = (unsigned int)simple_strtoul (argv[2], NULL, 16);
+ fslnum = (unsigned int)hextoul(argv[1], NULL);
+ blocking = (unsigned int)hextoul(argv[2], NULL);
if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
puts ("Bad number of FSL\n");
return CMD_RET_USAGE;
@@ -178,9 +178,9 @@ int do_fwr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (argc < 3)
return CMD_RET_USAGE;
- fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
- num = (unsigned int)simple_strtoul (argv[2], NULL, 16);
- blocking = (unsigned int)simple_strtoul (argv[3], NULL, 16);
+ fslnum = (unsigned int)hextoul(argv[1], NULL);
+ num = (unsigned int)hextoul(argv[2], NULL);
+ blocking = (unsigned int)hextoul(argv[3], NULL);
if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER)
return CMD_RET_USAGE;
@@ -332,8 +332,8 @@ int do_rspr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (argc < 2)
return CMD_RET_USAGE;
- reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
- val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
+ reg = (unsigned int)hextoul(argv[1], NULL);
+ val = (unsigned int)hextoul(argv[2], NULL);
switch (reg) {
case 0x1:
if (argc > 2) {