diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-24 18:03:29 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-08-02 20:32:14 +0300 |
commit | 7e5f460ec457fe310156e399198a41eb0ce1e98c (patch) | |
tree | 7e89e4d15fcea2d2263c4b4af1be69905537ef42 /arch | |
parent | 031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff) | |
download | u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.xz |
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 'arch')
25 files changed, 84 insertions, 84 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c index f1624ff30a..6eb7f9c214 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c @@ -565,28 +565,28 @@ void fdt_fixup_pfe_firmware(void *blob) if (!p) return; - pclassfw = (void *)simple_strtoul(p, NULL, 16); + pclassfw = (void *)hextoul(p, NULL); if (!pclassfw) return; p = env_get("class_elf_size"); if (!p) return; - len_class = simple_strtoul(p, NULL, 16); + len_class = hextoul(p, NULL); /* If the environment variable is not set, then exit silently */ p = env_get("tmu_elf_firmware"); if (!p) return; - ptmufw = (void *)simple_strtoul(p, NULL, 16); + ptmufw = (void *)hextoul(p, NULL); if (!ptmufw) return; p = env_get("tmu_elf_size"); if (!p) return; - len_tmu = simple_strtoul(p, NULL, 16); + len_tmu = hextoul(p, NULL); if (len_class == 0 || len_tmu == 0) { printf("PFE FW corrupted. CLASS FW size %d, TMU FW size %d\n", @@ -605,14 +605,14 @@ void fdt_fixup_pfe_firmware(void *blob) if (!p) return; - putilfw = (void *)simple_strtoul(p, NULL, 16); + putilfw = (void *)hextoul(p, NULL); if (!putilfw) return; p = env_get("util_elf_size"); if (!p) return; - len_util = simple_strtoul(p, NULL, 16); + len_util = hextoul(p, NULL); if (len_util) { printf("PFE Util PE firmware is not added to FDT.\n"); diff --git a/arch/arm/lib/semihosting.c b/arch/arm/lib/semihosting.c index 904fddd6c0..9fd82459b2 100644 --- a/arch/arm/lib/semihosting.c +++ b/arch/arm/lib/semihosting.c @@ -191,7 +191,7 @@ static int do_smhload(struct cmd_tbl *cmdtp, int flag, int argc, int ret; char end_str[64]; - load_addr = simple_strtoul(argv[2], NULL, 16); + load_addr = hextoul(argv[2], NULL); if (!load_addr) return -1; diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c index b10ead1942..40df10dd73 100644 --- a/arch/arm/mach-imx/cmd_dek.c +++ b/arch/arm/mach-imx/cmd_dek.c @@ -300,8 +300,8 @@ static int do_dek_blob(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != 4) return CMD_RET_USAGE; - src_addr = simple_strtoul(argv[1], NULL, 16); - dst_addr = simple_strtoul(argv[2], NULL, 16); + src_addr = hextoul(argv[1], NULL); + dst_addr = hextoul(argv[2], NULL); len = simple_strtoul(argv[3], NULL, 10); return blob_encap_dek(src_addr, dst_addr, len); diff --git a/arch/arm/mach-imx/cmd_mfgprot.c b/arch/arm/mach-imx/cmd_mfgprot.c index 1430f61909..29074fc298 100644 --- a/arch/arm/mach-imx/cmd_mfgprot.c +++ b/arch/arm/mach-imx/cmd_mfgprot.c @@ -71,7 +71,7 @@ static int do_mfgprot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (argc != 4) return CMD_RET_USAGE; - m_addr = simple_strtoul(argv[2], NULL, 16); + m_addr = hextoul(argv[2], NULL); m_size = simple_strtoul(argv[3], NULL, 10); m_ptr = map_physmem(m_addr, m_size, MAP_NOCACHE); if (!m_ptr) diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c index 7157c9e979..cd51344597 100644 --- a/arch/arm/mach-imx/cmd_nandbcb.c +++ b/arch/arm/mach-imx/cmd_nandbcb.c @@ -1083,13 +1083,13 @@ static int do_nandbcb_bcbonly(int argc, char *const argv[]) mtd = cfg.mtd; - cfg.boot_stream1_address = simple_strtoul(argv[2], NULL, 16); - cfg.boot_stream1_size = simple_strtoul(argv[3], NULL, 16); + cfg.boot_stream1_address = hextoul(argv[2], NULL); + cfg.boot_stream1_size = hextoul(argv[3], NULL); cfg.boot_stream1_size = ALIGN(cfg.boot_stream1_size, mtd->writesize); if (argc > 5) { - cfg.boot_stream2_address = simple_strtoul(argv[4], NULL, 16); - cfg.boot_stream2_size = simple_strtoul(argv[5], NULL, 16); + cfg.boot_stream2_address = hextoul(argv[4], NULL); + cfg.boot_stream2_size = hextoul(argv[5], NULL); cfg.boot_stream2_size = ALIGN(cfg.boot_stream2_size, mtd->writesize); } @@ -1450,7 +1450,7 @@ static int do_nandbcb_init(int argc, char * const argv[]) if (nandbcb_set_boot_config(argc, argv, &cfg)) return CMD_RET_FAILURE; - addr = simple_strtoul(argv[1], &endp, 16); + addr = hextoul(argv[1], &endp); if (*argv[1] == 0 || *endp != 0) return CMD_RET_FAILURE; diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index 00bd157d0e..cc39e6bf56 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -609,12 +609,12 @@ static int do_authenticate_image(struct cmd_tbl *cmdtp, int flag, int argc, if (argc < 3) return CMD_RET_USAGE; - addr = simple_strtoul(argv[1], NULL, 16); - length = simple_strtoul(argv[2], NULL, 16); + addr = hextoul(argv[1], NULL); + length = hextoul(argv[2], NULL); if (argc == 3) ivt_offset = get_image_ivt_offset(addr); else - ivt_offset = simple_strtoul(argv[3], NULL, 16); + ivt_offset = hextoul(argv[3], NULL); rcode = imx_hab_authenticate_image(addr, length, ivt_offset); if (rcode == 0) diff --git a/arch/arm/mach-imx/imx8/ahab.c b/arch/arm/mach-imx/imx8/ahab.c index 6392fe267a..015267c8b2 100644 --- a/arch/arm/mach-imx/imx8/ahab.c +++ b/arch/arm/mach-imx/imx8/ahab.c @@ -161,7 +161,7 @@ static int do_authenticate(struct cmd_tbl *cmdtp, int flag, int argc, if (argc < 2) return CMD_RET_USAGE; - addr = simple_strtoul(argv[1], NULL, 16); + addr = hextoul(argv[1], NULL); printf("Authenticate OS container at 0x%lx\n", addr); diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c index 6f9b1c99fc..7c34ce6d5f 100644 --- a/arch/arm/mach-imx/imx8/snvs_security_sc.c +++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c @@ -638,24 +638,24 @@ static int do_snvs_cfg(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != (NB_REGISTERS + 1)) return CMD_RET_USAGE; - conf.hp.lock = simple_strtoul(argv[++idx], NULL, 16); - conf.hp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.lock = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.tamper_filt_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.tamper_det_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.tamper_det_cfg2 = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.tamper_filt1_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.tamper_filt2_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper1_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper2_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper3_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper4_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper5_cfg = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper_clk_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper_routing_ctl1 = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.act_tamper_routing_ctl2 = simple_strtoul(argv[++idx], NULL, 16); + conf.hp.lock = hextoul(argv[++idx], NULL); + conf.hp.secvio_ctl = hextoul(argv[++idx], NULL); + conf.lp.lock = hextoul(argv[++idx], NULL); + conf.lp.secvio_ctl = hextoul(argv[++idx], NULL); + conf.lp.tamper_filt_cfg = hextoul(argv[++idx], NULL); + conf.lp.tamper_det_cfg = hextoul(argv[++idx], NULL); + conf.lp.tamper_det_cfg2 = hextoul(argv[++idx], NULL); + conf.lp.tamper_filt1_cfg = hextoul(argv[++idx], NULL); + conf.lp.tamper_filt2_cfg = hextoul(argv[++idx], NULL); + conf.lp.act_tamper1_cfg = hextoul(argv[++idx], NULL); + conf.lp.act_tamper2_cfg = hextoul(argv[++idx], NULL); + conf.lp.act_tamper3_cfg = hextoul(argv[++idx], NULL); + conf.lp.act_tamper4_cfg = hextoul(argv[++idx], NULL); + conf.lp.act_tamper5_cfg = hextoul(argv[++idx], NULL); + conf.lp.act_tamper_ctl = hextoul(argv[++idx], NULL); + conf.lp.act_tamper_clk_ctl = hextoul(argv[++idx], NULL); + conf.lp.act_tamper_routing_ctl1 = hextoul(argv[++idx], NULL); + conf.lp.act_tamper_routing_ctl2 = hextoul(argv[++idx], NULL); err = apply_snvs_config(&conf); @@ -690,12 +690,12 @@ static int do_snvs_dgo_cfg(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != (6 + 1)) return CMD_RET_USAGE; - conf.tamper_offset_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.tamper_pull_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.tamper_ana_test_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.tamper_sensor_trim_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.tamper_misc_ctl = simple_strtoul(argv[++idx], NULL, 16); - conf.tamper_core_volt_mon_ctl = simple_strtoul(argv[++idx], NULL, 16); + conf.tamper_offset_ctl = hextoul(argv[++idx], NULL); + conf.tamper_pull_ctl = hextoul(argv[++idx], NULL); + conf.tamper_ana_test_ctl = hextoul(argv[++idx], NULL); + conf.tamper_sensor_trim_ctl = hextoul(argv[++idx], NULL); + conf.tamper_misc_ctl = hextoul(argv[++idx], NULL); + conf.tamper_core_volt_mon_ctl = hextoul(argv[++idx], NULL); err = apply_snvs_dgo_config(&conf); @@ -727,7 +727,7 @@ static int do_tamper_pin_cfg(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; conf.pad = simple_strtoul(argv[++idx], NULL, 10); - conf.mux_conf = simple_strtoul(argv[++idx], NULL, 16); + conf.mux_conf = hextoul(argv[++idx], NULL); err = apply_tamper_pin_list_config(&conf, 1); @@ -761,8 +761,8 @@ static int do_snvs_clear_status(struct cmd_tbl *cmdtp, int flag, int argc, if (argc != (2 + 1)) return CMD_RET_USAGE; - conf.lp.status = simple_strtoul(argv[++idx], NULL, 16); - conf.lp.tamper_det_status = simple_strtoul(argv[++idx], NULL, 16); + conf.lp.status = hextoul(argv[++idx], NULL); + conf.lp.tamper_det_status = hextoul(argv[++idx], NULL); scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.status), &conf.lp.status, NULL, NULL, NULL, diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c index 30fb45d48c..9ffe5ac6e3 100644 --- a/arch/arm/mach-imx/imx_bootaux.c +++ b/arch/arm/mach-imx/imx_bootaux.c @@ -180,7 +180,7 @@ static int do_bootaux(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } - addr = simple_strtoul(argv[1], NULL, 16); + addr = hextoul(argv[1], NULL); if (!addr) return CMD_RET_FAILURE; diff --git a/arch/arm/mach-imx/mx6/mp.c b/arch/arm/mach-imx/mx6/mp.c index 2fdf070a08..de9ace083c 100644 --- a/arch/arm/mach-imx/mx6/mp.c +++ b/arch/arm/mach-imx/mx6/mp.c @@ -47,7 +47,7 @@ int cpu_release(u32 nr, int argc, char *const argv[]) { uint32_t boot_addr; - boot_addr = simple_strtoul(argv[0], NULL, 16); + boot_addr = hextoul(argv[0], NULL); switch (nr) { case 1: diff --git a/arch/arm/mach-keystone/cmd_mon.c b/arch/arm/mach-keystone/cmd_mon.c index 049d573473..e26296b6da 100644 --- a/arch/arm/mach-keystone/cmd_mon.c +++ b/arch/arm/mach-keystone/cmd_mon.c @@ -25,7 +25,7 @@ static int do_mon_install(struct cmd_tbl *cmdtp, int flag, int argc, freq = CONFIG_SYS_HZ_CLOCK; - addr = simple_strtoul(argv[1], NULL, 16); + addr = hextoul(argv[1], NULL); header = (struct image_header *)addr; @@ -40,7 +40,7 @@ static int do_mon_install(struct cmd_tbl *cmdtp, int flag, int argc, size); if (argc >= 3) - ecrypt_bm_addr = simple_strtoul(argv[2], NULL, 16); + ecrypt_bm_addr = hextoul(argv[2], NULL); rcode = mon_install(load_addr, dpsc_base, freq, ecrypt_bm_addr); printf("## installed monitor @ 0x%x, freq [%d], status %d\n", @@ -76,8 +76,8 @@ int do_mon_power(struct cmd_tbl *cmdtp, int flag, int argc, if (argc < 3) return CMD_RET_USAGE; - core_id = simple_strtoul(argv[1], NULL, 16); - on = simple_strtoul(argv[2], NULL, 16); + core_id = hextoul(argv[1], NULL); + on = hextoul(argv[2], NULL); if (on) rcode = mon_power_on(core_id, fn); diff --git a/arch/arm/mach-snapdragon/misc.c b/arch/arm/mach-snapdragon/misc.c index aaa561c2c6..985625a548 100644 --- a/arch/arm/mach-snapdragon/misc.c +++ b/arch/arm/mach-snapdragon/misc.c @@ -47,7 +47,7 @@ void msm_generate_mac_addr(u8 *mac) mac[0] = 0x02; mac[1] = 00; for (i = 3; i >= 0; i--) { - mac[i + 2] = simple_strtoul(&sn[2 * i], NULL, 16); + mac[i + 2] = hextoul(&sn[2 * i], NULL); sn[2 * i] = 0; } } diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c index 64a7c9d652..f8d3d48ee8 100644 --- a/arch/arm/mach-socfpga/misc.c +++ b/arch/arm/mach-socfpga/misc.c @@ -191,7 +191,7 @@ static int do_bridge(struct cmd_tbl *cmdtp, int flag, int argc, argv++; if (argc == 3) - mask = simple_strtoul(argv[1], NULL, 16); + mask = hextoul(argv[1], NULL); switch (*argv[0]) { case 'e': /* Enable */ diff --git a/arch/arm/mach-socfpga/vab.c b/arch/arm/mach-socfpga/vab.c index 85b3f30211..e146f2c529 100644 --- a/arch/arm/mach-socfpga/vab.c +++ b/arch/arm/mach-socfpga/vab.c @@ -17,8 +17,8 @@ static int do_vab(struct cmd_tbl *cmdtp, int flag, int argc, if (argc < 3) return CMD_RET_USAGE; - addr = simple_strtoul(argv[1], NULL, 16); - len = simple_strtoul(argv[2], NULL, 16); + addr = hextoul(argv[1], NULL); + len = hextoul(argv[2], NULL); if (socfpga_vendor_authentication((void *)&addr, (size_t *)&len) != 0) return CMD_RET_FAILURE; diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c index 50840b0f38..68f28922d1 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32key.c +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c @@ -162,7 +162,7 @@ static int do_stm32key_read(struct cmd_tbl *cmdtp, int flag, int argc, char *con return CMD_RET_SUCCESS; } - addr = simple_strtoul(argv[1], NULL, 16); + addr = hextoul(argv[1], NULL); if (!addr) return CMD_RET_USAGE; @@ -185,7 +185,7 @@ static int do_stm32key_fuse(struct cmd_tbl *cmdtp, int flag, int argc, char *con yes = true; } - addr = simple_strtoul(argv[argc - 1], NULL, 16); + addr = hextoul(argv[argc - 1], NULL); if (!addr) return CMD_RET_USAGE; diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c index 064f51b2c7..bf9a686e96 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c @@ -64,12 +64,12 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc, addr = STM32_DDR_BASE; size = 0; if (argc > 3) { - addr = simple_strtoul(argv[3], NULL, 16); + addr = hextoul(argv[3], NULL); if (!addr) return CMD_RET_FAILURE; } if (argc > 4) - size = simple_strtoul(argv[4], NULL, 16); + size = hextoul(argv[4], NULL); /* check STM32IMAGE presence */ if (size == 0) { diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c index b33c4b1938..b5356ed87e 100644 --- a/arch/arm/mach-uniphier/board_late_init.c +++ b/arch/arm/mach-uniphier/board_late_init.c @@ -66,7 +66,7 @@ static void uniphier_set_env_addr(const char *env, const char *offset_env) if (!str) goto fail; - offset = simple_strtoul(str, &end, 16); + offset = hextoul(str, &end); if (*end) goto fail; } diff --git a/arch/arm/mach-zynqmp/mp.c b/arch/arm/mach-zynqmp/mp.c index 74783ae5a7..704520e7a3 100644 --- a/arch/arm/mach-zynqmp/mp.c +++ b/arch/arm/mach-zynqmp/mp.c @@ -252,7 +252,7 @@ int cpu_release(u32 nr, int argc, char *const argv[]) return 1; } - u32 boot_addr = simple_strtoul(argv[0], NULL, 16); + u32 boot_addr = hextoul(argv[0], NULL); u32 boot_addr_uniq = 0; if (!(boot_addr == ZYNQMP_R5_LOVEC_ADDR || boot_addr == ZYNQMP_R5_HIVEC_ADDR)) { diff --git a/arch/mips/mach-octeon/bootoctlinux.c b/arch/mips/mach-octeon/bootoctlinux.c index c195dc28ad..349da08da6 100644 --- a/arch/mips/mach-octeon/bootoctlinux.c +++ b/arch/mips/mach-octeon/bootoctlinux.c @@ -281,8 +281,7 @@ int octeon_parse_bootopts(int argc, char *const argv[], } else if (!strncmp(argv[arg], "forceboot", 9)) { boot_args->forceboot = true; } else if (!strncmp(argv[arg], "nodemask=", 9)) { - boot_args->node_mask = simple_strtoul(argv[arg] + 9, - NULL, 16); + boot_args->node_mask = hextoul(argv[arg] + 9, NULL); } else if (!strncmp(argv[arg], "numcores=", 9)) { memset(node_values, 0, sizeof(node_values)); num_values = octeon_parse_nodes(node_values, @@ -383,7 +382,7 @@ int do_bootoctlinux(struct cmd_tbl *cmdtp, int flag, int argc, argv[1][1] == 'x' || argv[1][1] == 'X' || argv[1][1] == '\0'))) { - addr = simple_strtoul(argv[1], NULL, 16); + addr = hextoul(argv[1], NULL); if (!addr) addr = CONFIG_SYS_LOAD_ADDR; arg_start++; diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c index b3b8bc2903..4cb0f530ae 100644 --- a/arch/nds32/lib/bootm.c +++ b/arch/nds32/lib/bootm.c @@ -64,7 +64,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) s = env_get("machid"); if (s) { - machid = simple_strtoul(s, NULL, 16); + machid = hextoul(s, NULL); printf("Using machid 0x%x from environment\n", machid); } diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c index 2c8f9731c7..5037467151 100644 --- a/arch/nios2/lib/bootm.c +++ b/arch/nios2/lib/bootm.c @@ -27,7 +27,7 @@ int do_bootm_linux(int flag, int argc, char *const argv[], of_flat_tree = images->ft_addr; #endif if (!of_flat_tree && argc > 1) - of_flat_tree = (char *)simple_strtoul(argv[1], NULL, 16); + of_flat_tree = (char *)hextoul(argv[1], NULL); if (of_flat_tree) initrd_end = (ulong)of_flat_tree; diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c index 1343dd3d3a..68a7a780d2 100644 --- a/arch/powerpc/cpu/mpc83xx/ecc.c +++ b/arch/powerpc/cpu/mpc83xx/ecc.c @@ -219,17 +219,17 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) ddr->err_detect = val; return 0; } else if (strcmp(argv[1], "injectdatahi") == 0) { - val = simple_strtoul(argv[2], NULL, 16); + val = hextoul(argv[2], NULL); ddr->data_err_inject_hi = val; return 0; } else if (strcmp(argv[1], "injectdatalo") == 0) { - val = simple_strtoul(argv[2], NULL, 16); + val = hextoul(argv[2], NULL); ddr->data_err_inject_lo = val; return 0; } else if (strcmp(argv[1], "injectecc") == 0) { - val = simple_strtoul(argv[2], NULL, 16); + val = hextoul(argv[2], NULL); if (val > 0xff) { printf("Incorrect ECC inject mask, " "should be 0x00..0xff\n"); @@ -269,8 +269,8 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) } if (argc == 4) { if (strcmp(argv[1], "testdw") == 0) { - addr = (u64 *) simple_strtoul(argv[2], NULL, 16); - count = simple_strtoul(argv[3], NULL, 16); + addr = (u64 *)hextoul(argv[2], NULL); + count = hextoul(argv[3], NULL); if ((u32) addr % 8) { printf("Address not aligned on " @@ -308,8 +308,8 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return 0; } if (strcmp(argv[1], "testword") == 0) { - addr = (u64 *) simple_strtoul(argv[2], NULL, 16); - count = simple_strtoul(argv[3], NULL, 16); + addr = (u64 *)hextoul(argv[2], NULL); + count = hextoul(argv[3], NULL); if ((u32) addr % 8) { printf("Address not aligned on " diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c index 653efe09f9..b1b002c900 100644 --- a/arch/powerpc/cpu/mpc85xx/mp.c +++ b/arch/powerpc/cpu/mpc85xx/mp.c @@ -167,7 +167,7 @@ int cpu_release(u32 nr, int argc, char *const argv[]) for (i = 1; i < 3; i++) { if (argv[i][0] != '-') { u8 entry = boot_entry_map[i]; - val = simple_strtoul(argv[i], NULL, 16); + val = hextoul(argv[i], NULL); table[entry] = val; } } diff --git a/arch/sh/lib/zimageboot.c b/arch/sh/lib/zimageboot.c index c38f0933f8..c2e285ff0f 100644 --- a/arch/sh/lib/zimageboot.c +++ b/arch/sh/lib/zimageboot.c @@ -37,11 +37,12 @@ int do_sh_zimageboot(struct cmd_tbl *cmdtp, int flag, int argc, } if (s0) - zboot_entry = (ulong (*)(int, char * const []))simple_strtoul(s0, NULL, 16); + zboot_entry = (ulong (*)(int, char * const []))hextoul(s0, + NULL); /* empty_zero_page */ if (s1) - param = (unsigned char*)simple_strtoul(s1, NULL, 16); + param = (unsigned char *)hextoul(s1, NULL); /* Linux kernel command line */ cmdline = (char *)param + COMMAND_LINE; diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index cf4210cd4b..9938c80a42 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -405,17 +405,17 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, } if (s) - state.bzimage_addr = simple_strtoul(s, NULL, 16); + state.bzimage_addr = hextoul(s, NULL); if (argc >= 3) { /* argv[2] holds the size of the bzImage */ - state.bzimage_size = simple_strtoul(argv[2], NULL, 16); + state.bzimage_size = hextoul(argv[2], NULL); } if (argc >= 4) - state.initrd_addr = simple_strtoul(argv[3], NULL, 16); + state.initrd_addr = hextoul(argv[3], NULL); if (argc >= 5) - state.initrd_size = simple_strtoul(argv[4], NULL, 16); + state.initrd_size = hextoul(argv[4], NULL); if (argc >= 6) { /* * When the base_ptr is passed in, we assume that the image is @@ -428,7 +428,7 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, * load address and set bzimage_addr to 0 so we know that it * cannot be proceesed (or processed again). */ - state.base_ptr = (void *)simple_strtoul(argv[5], NULL, 16); + state.base_ptr = (void *)hextoul(argv[5], NULL); state.load_address = state.bzimage_addr; state.bzimage_addr = 0; } @@ -702,7 +702,7 @@ static int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc, struct boot_params *base_ptr = state.base_ptr; if (argc > 1) - base_ptr = (void *)simple_strtoul(argv[1], NULL, 16); + base_ptr = (void *)hextoul(argv[1], NULL); if (!base_ptr) { printf("No zboot setup_base\n"); return CMD_RET_FAILURE; @@ -749,7 +749,7 @@ int do_zboot_parent(struct cmd_tbl *cmdtp, int flag, int argc, if (argc > 1) { char *endp; - simple_strtoul(argv[1], &endp, 16); + hextoul(argv[1], &endp); /* * endp pointing to nul means that argv[1] was just a valid * number, so pass it along to the normal processing |