From 0b1284eb52578e15ec611adc5fee1a9ae68dadea Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 24 Jul 2021 09:03:30 -0600 Subject: global: Convert simple_strtoul() with decimal to dectoul() It is a pain to have to specify the value 10 in each call. Add a new dectoul() function and update the code to use it. Signed-off-by: Simon Glass --- board/gdsys/common/cmd_ioloop.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'board/gdsys') diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c index 658756d984..1412421a02 100644 --- a/board/gdsys/common/cmd_ioloop.c +++ b/board/gdsys/common/cmd_ioloop.c @@ -275,13 +275,13 @@ int do_ioreflect(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) if (argc < 2) return CMD_RET_USAGE; - fpga = simple_strtoul(argv[1], NULL, 10); + fpga = dectoul(argv[1], NULL); /* * If another parameter, it is the report rate in packets. */ if (argc > 2) - rate = simple_strtoul(argv[2], NULL, 10); + rate = dectoul(argv[2], NULL); /* Enable receive path */ FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE); @@ -388,18 +388,18 @@ int do_ioloop(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) /* * FPGA is specified since argc > 2 */ - fpga = simple_strtoul(argv[1], NULL, 10); + fpga = dectoul(argv[1], NULL); /* * packet size is specified since argc > 2 */ - size = simple_strtoul(argv[2], NULL, 10); + size = dectoul(argv[2], NULL); /* * If another parameter, it is the test rate in packets per second. */ if (argc > 3) - rate = simple_strtoul(argv[3], NULL, 10); + rate = dectoul(argv[3], NULL); /* enable receive path */ FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE); @@ -463,13 +463,13 @@ int do_ioloop(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) /* * packet size is specified since argc > 1 */ - size = simple_strtoul(argv[2], NULL, 10); + size = dectoul(argv[2], NULL); /* * If another parameter, it is the test rate in packets per second. */ if (argc > 2) - rate = simple_strtoul(argv[3], NULL, 10); + rate = dectoul(argv[3], NULL); /* Enable receive path */ misc_set_enabled(dev, true); @@ -514,7 +514,7 @@ int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_FAILURE; if (argc > 1) { - int i = simple_strtoul(argv[1], NULL, 10); + int i = dectoul(argv[1], NULL); snprintf(name, sizeof(name), "ioep%d", i); -- cgit v1.2.3