aboutsummaryrefslogtreecommitdiff
path: root/cmd/x86
diff options
context:
space:
mode:
authorSimon Glass2021-07-24 09:03:29 -0600
committerTom Rini2021-08-02 13:32:14 -0400
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /cmd/x86
parent031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff)
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/x86')
-rw-r--r--cmd/x86/mtrr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index fc61a549b02..b213a942fde 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -78,8 +78,8 @@ static int do_mtrr_set(int cpu_select, uint reg, int argc, char *const argv[])
printf("Invalid type name %s\n", typename);
return CMD_RET_USAGE;
}
- start = simple_strtoul(argv[1], NULL, 16);
- size = simple_strtoul(argv[2], NULL, 16);
+ start = hextoul(argv[1], NULL);
+ size = hextoul(argv[2], NULL);
base = start | type;
valid = native_read_msr(MTRR_PHYS_MASK_MSR(reg)) & MTRR_PHYS_MASK_VALID;
@@ -126,7 +126,7 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
if (cmd != 'l') {
if (argc < 2)
return CMD_RET_USAGE;
- reg = simple_strtoul(argv[1], NULL, 16);
+ reg = hextoul(argv[1], NULL);
if (reg >= reg_count) {
printf("Invalid register number\n");
return CMD_RET_USAGE;