diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 09:03:29 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 13:32:14 -0400 |
commit | 7e5f460ec457fe310156e399198a41eb0ce1e98c (patch) | |
tree | 7e89e4d15fcea2d2263c4b4af1be69905537ef42 /arch/powerpc/cpu | |
parent | 031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff) | |
download | u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.gz |
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 'arch/powerpc/cpu')
-rw-r--r-- | arch/powerpc/cpu/mpc83xx/ecc.c | 14 | ||||
-rw-r--r-- | arch/powerpc/cpu/mpc85xx/mp.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c index 1343dd3d3a..68a7a780d2 100644 --- a/arch/powerpc/cpu/mpc83xx/ecc.c +++ b/arch/powerpc/cpu/mpc83xx/ecc.c @@ -219,17 +219,17 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) ddr->err_detect = val; return 0; } else if (strcmp(argv[1], "injectdatahi") == 0) { - val = simple_strtoul(argv[2], NULL, 16); + val = hextoul(argv[2], NULL); ddr->data_err_inject_hi = val; return 0; } else if (strcmp(argv[1], "injectdatalo") == 0) { - val = simple_strtoul(argv[2], NULL, 16); + val = hextoul(argv[2], NULL); ddr->data_err_inject_lo = val; return 0; } else if (strcmp(argv[1], "injectecc") == 0) { - val = simple_strtoul(argv[2], NULL, 16); + val = hextoul(argv[2], NULL); if (val > 0xff) { printf("Incorrect ECC inject mask, " "should be 0x00..0xff\n"); @@ -269,8 +269,8 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc == 4) { if (strcmp(argv[1], "testdw") == 0) { - addr = (u64 *) simple_strtoul(argv[2], NULL, 16); - count = simple_strtoul(argv[3], NULL, 16); + addr = (u64 *)hextoul(argv[2], NULL); + count = hextoul(argv[3], NULL); if ((u32) addr % 8) { printf("Address not aligned on " @@ -308,8 +308,8 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } if (strcmp(argv[1], "testword") == 0) { - addr = (u64 *) simple_strtoul(argv[2], NULL, 16); - count = simple_strtoul(argv[3], NULL, 16); + addr = (u64 *)hextoul(argv[2], NULL); + count = hextoul(argv[3], NULL); if ((u32) addr % 8) { printf("Address not aligned on " diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c index 653efe09f9..b1b002c900 100644 --- a/arch/powerpc/cpu/mpc85xx/mp.c +++ b/arch/powerpc/cpu/mpc85xx/mp.c @@ -167,7 +167,7 @@ int cpu_release(u32 nr, int argc, char *const argv[]) for (i = 1; i < 3; i++) { if (argv[i][0] != '-') { u8 entry = boot_entry_map[i]; - val = simple_strtoul(argv[i], NULL, 16); + val = hextoul(argv[i], NULL); table[entry] = val; } } |