aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc83xx
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 /arch/powerpc/cpu/mpc83xx
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 'arch/powerpc/cpu/mpc83xx')
-rw-r--r--arch/powerpc/cpu/mpc83xx/ecc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c
index 1343dd3..68a7a78 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 "