// SPDX-License-Identifier: GPL-2.0+
-#include <common.h>
#include <command.h>
+#include <env.h>
#include <hexdump.h>
#include <malloc.h>
#include <mapmem.h>
+#include <vsprintf.h>
#include <linux/ctype.h>
enum {
ulong addr;
u8 *buf;
- addr = simple_strtoul(varname, NULL, 16);
+ addr = hextoul(varname, NULL);
buf = map_sysmem(addr, len);
memcpy(buf, result, len);
unmap_sysmem(buf);
}
-static int do_binop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_binop(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong len;
u8 *result, *src1, *src2;
else
return CMD_RET_USAGE;
- len = simple_strtoul(lenarg, NULL, 10);
+ len = dectoul(lenarg, NULL);
src1 = malloc(len);
src2 = malloc(len);
if (*src1arg == '*')
- read_from_mem(simple_strtoul(src1arg + 1, NULL, 16), src1, len);
+ read_from_mem(hextoul(src1arg + 1, NULL), src1, len);
else
read_from_env_var(src1arg, src1);
if (*src2arg == '*')
- read_from_mem(simple_strtoul(src2arg + 1, NULL, 16), src2, len);
+ read_from_mem(hextoul(src2arg + 1, NULL), src2, len);
else
read_from_env_var(src2arg, src2);