diff options
| author | Tom Rini <[email protected]> | 2021-08-02 13:32:20 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-08-02 13:32:20 -0400 |
| commit | 51aef405550e603ff702c034f0e2cd0f15bdf2bb (patch) | |
| tree | 15216d11d6890cd497b6a97176c7aad4c4d63ecf /cmd/mtd.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/mtd.c')
| -rw-r--r-- | cmd/mtd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/mtd.c b/cmd/mtd.c index c22478c1527..ad5cc9827d5 100644 --- a/cmd/mtd.c +++ b/cmd/mtd.c @@ -285,12 +285,12 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc, goto out_put_mtd; } - user_addr = simple_strtoul(argv[0], NULL, 16); + user_addr = hextoul(argv[0], NULL); argc--; argv++; } - start_off = argc > 0 ? simple_strtoul(argv[0], NULL, 16) : 0; + start_off = argc > 0 ? hextoul(argv[0], NULL) : 0; if (!mtd_is_aligned_with_min_io_size(mtd, start_off)) { printf("Offset not aligned with a page (0x%x)\n", mtd->writesize); @@ -299,7 +299,7 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc, } default_len = dump ? mtd->writesize : mtd->size; - len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : default_len; + len = argc > 1 ? hextoul(argv[1], NULL) : default_len; if (!mtd_is_aligned_with_min_io_size(mtd, len)) { len = round_up(len, mtd->writesize); printf("Size not on a page boundary (0x%x), rounding to 0x%llx\n", @@ -411,8 +411,8 @@ static int do_mtd_erase(struct cmd_tbl *cmdtp, int flag, int argc, argc -= 2; argv += 2; - off = argc > 0 ? simple_strtoul(argv[0], NULL, 16) : 0; - len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : mtd->size; + off = argc > 0 ? hextoul(argv[0], NULL) : 0; + len = argc > 1 ? hextoul(argv[1], NULL) : mtd->size; if (!mtd_is_aligned_with_block_size(mtd, off)) { printf("Offset not aligned with a block (0x%x)\n", |
