diff options
author | Tom Rini <trini@konsulko.com> | 2021-08-02 13:32:20 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 13:32:20 -0400 |
commit | 51aef405550e603ff702c034f0e2cd0f15bdf2bb (patch) | |
tree | 15216d11d6890cd497b6a97176c7aad4c4d63ecf /cmd/pci.c | |
parent | 73994c452fc5a960114360a651201ac48b135e81 (diff) | |
parent | e6951139c0544116330b12e287fe45e30bbab11c (diff) |
Merge branch '2021-08-02-numeric-input-cleanups'
- Merge in a series that cleans up and makes more consistent how we deal
with numeric input on the CLI. This saves a few bytes in a lot of
places.
Diffstat (limited to 'cmd/pci.c')
-rw-r--r-- | cmd/pci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/pci.c b/cmd/pci.c index e53b7c858c6..22de9426c9b 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -470,14 +470,14 @@ static pci_dev_t get_pci_dev(char *name) if (name[i] == '.') { memcpy(cnum, &name[iold], i - iold); cnum[i - iold] = '\0'; - bdfs[n++] = simple_strtoul(cnum, NULL, 16); + bdfs[n++] = hextoul(cnum, NULL); iold = i + 1; } } strcpy(cnum, &name[iold]); if (n == 0) n = 1; - bdfs[n] = simple_strtoul(cnum, NULL, 16); + bdfs[n] = hextoul(cnum, NULL); return PCI_BDF(bdfs[0], bdfs[1], bdfs[2]); } @@ -588,7 +588,7 @@ static int pci_cfg_modify(pci_dev_t bdf, ulong addr, ulong size, ulong value, #endif else { char *endp; - i = simple_strtoul(console_buffer, &endp, 16); + i = hextoul(console_buffer, &endp); nbytes = endp - console_buffer; if (nbytes) { /* good enough to not time out @@ -683,9 +683,9 @@ static int do_pci(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) cmd_size = cmd_get_data_size(argv[1], 4); size = (cmd_size == 4) ? PCI_SIZE_32 : cmd_size - 1; if (argc > 3) - addr = simple_strtoul(argv[3], NULL, 16); + addr = hextoul(argv[3], NULL); if (argc > 4) - value = simple_strtoul(argv[4], NULL, 16); + value = hextoul(argv[4], NULL); case 'h': /* header */ #ifdef CONFIG_DM_PCI case 'b': /* bars */ @@ -709,7 +709,7 @@ static int do_pci(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) argc--; } if (argc > 1) - busnum = simple_strtoul(argv[1], NULL, 16); + busnum = hextoul(argv[1], NULL); } #ifdef CONFIG_DM_PCI ret = uclass_get_device_by_seq(UCLASS_PCI, busnum, &bus); |