aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:30 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch)
tree2d83815e93fc16decbaa5671fd660ade0ec74532 /arch
parent7e5f460ec457fe310156e399198a41eb0ce1e98c (diff)
downloadu-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.zip
u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.gz
u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.bz2
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 <sjg@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/soc.c2
-rw-r--r--arch/arm/mach-imx/cmd_dek.c2
-rw-r--r--arch/arm/mach-imx/cmd_mfgprot.c2
-rw-r--r--arch/arm/mach-imx/imx8/snvs_security_sc.c2
-rw-r--r--arch/arm/mach-keystone/cmd_clock.c10
-rw-r--r--arch/arm/mach-kirkwood/cpu.c2
-rw-r--r--arch/arm/mach-nexell/clock.c2
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c2
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c2
-rw-r--r--arch/powerpc/cpu/mpc83xx/ecc.c4
10 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 0562d28..1641b65 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -277,7 +277,7 @@ static unsigned long get_internval_val_mhz(void)
ulong interval_mhz = get_bus_freq(0) / (1000 * 1000);
if (interval)
- interval_mhz = simple_strtoul(interval, NULL, 10);
+ interval_mhz = dectoul(interval, NULL);
return interval_mhz;
}
diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c
index 40df10d..1e3cfee 100644
--- a/arch/arm/mach-imx/cmd_dek.c
+++ b/arch/arm/mach-imx/cmd_dek.c
@@ -302,7 +302,7 @@ static int do_dek_blob(struct cmd_tbl *cmdtp, int flag, int argc,
src_addr = hextoul(argv[1], NULL);
dst_addr = hextoul(argv[2], NULL);
- len = simple_strtoul(argv[3], NULL, 10);
+ len = dectoul(argv[3], NULL);
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 29074fc..1e866b7 100644
--- a/arch/arm/mach-imx/cmd_mfgprot.c
+++ b/arch/arm/mach-imx/cmd_mfgprot.c
@@ -72,7 +72,7 @@ static int do_mfgprot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return CMD_RET_USAGE;
m_addr = hextoul(argv[2], NULL);
- m_size = simple_strtoul(argv[3], NULL, 10);
+ m_size = dectoul(argv[3], NULL);
m_ptr = map_physmem(m_addr, m_size, MAP_NOCACHE);
if (!m_ptr)
return -ENOMEM;
diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c
index 7c34ce6..507b5b4 100644
--- a/arch/arm/mach-imx/imx8/snvs_security_sc.c
+++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c
@@ -726,7 +726,7 @@ static int do_tamper_pin_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc != (2 + 1))
return CMD_RET_USAGE;
- conf.pad = simple_strtoul(argv[++idx], NULL, 10);
+ conf.pad = dectoul(argv[++idx], NULL);
conf.mux_conf = hextoul(argv[++idx], NULL);
err = apply_tamper_pin_list_config(&conf, 1);
diff --git a/arch/arm/mach-keystone/cmd_clock.c b/arch/arm/mach-keystone/cmd_clock.c
index 7165d66..72dc394 100644
--- a/arch/arm/mach-keystone/cmd_clock.c
+++ b/arch/arm/mach-keystone/cmd_clock.c
@@ -42,9 +42,9 @@ int do_pll_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
else
goto pll_cmd_usage;
- cmd_pll_data.pll_m = simple_strtoul(argv[2], NULL, 10);
- cmd_pll_data.pll_d = simple_strtoul(argv[3], NULL, 10);
- cmd_pll_data.pll_od = simple_strtoul(argv[4], NULL, 10);
+ cmd_pll_data.pll_m = dectoul(argv[2], NULL);
+ cmd_pll_data.pll_d = dectoul(argv[3], NULL);
+ cmd_pll_data.pll_od = dectoul(argv[4], NULL);
printf("Trying to set pll %d; mult %d; div %d; OD %d\n",
cmd_pll_data.pll, cmd_pll_data.pll_m,
@@ -72,7 +72,7 @@ int do_getclk_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc != 2)
goto getclk_cmd_usage;
- clk = simple_strtoul(argv[1], NULL, 10);
+ clk = dectoul(argv[1], NULL);
freq = ks_clk_get_rate(clk);
if (freq)
@@ -101,7 +101,7 @@ int do_psc_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (argc != 3)
goto psc_cmd_usage;
- psc_module = simple_strtoul(argv[1], NULL, 10);
+ psc_module = dectoul(argv[1], NULL);
if (strcmp(argv[2], "en") == 0) {
res = psc_enable_module(psc_module);
printf("psc_enable_module(%d) - %s\n", psc_module,
diff --git a/arch/arm/mach-kirkwood/cpu.c b/arch/arm/mach-kirkwood/cpu.c
index 339ae7f..3953aa9 100644
--- a/arch/arm/mach-kirkwood/cpu.c
+++ b/arch/arm/mach-kirkwood/cpu.c
@@ -125,7 +125,7 @@ static void kw_sysrst_check(void)
return;
/* read sysrstdelay value */
- sysrst_dly = (u32) simple_strtoul(s, NULL, 10);
+ sysrst_dly = (u32)dectoul(s, NULL);
/* read SysRst Length counter register (bits 28:0) */
sysrst_cnt = (0x1fffffff & readl(KW_REG_SYSRST_CNT));
diff --git a/arch/arm/mach-nexell/clock.c b/arch/arm/mach-nexell/clock.c
index d5b46a8..24fa204 100644
--- a/arch/arm/mach-nexell/clock.c
+++ b/arch/arm/mach-nexell/clock.c
@@ -592,7 +592,7 @@ struct clk *clk_get(const char *id)
c = strrchr((const char *)str, (int)'.');
if (!c || !cdev->peri)
break;
- devid = simple_strtoul(++c, NULL, 10);
+ devid = dectoul(++c, NULL);
if (cdev->peri->dev_id == devid)
break;
}
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index bf9a686..be53a52 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -59,7 +59,7 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
}
- dev = (int)simple_strtoul(argv[2], NULL, 10);
+ dev = (int)dectoul(argv[2], NULL);
addr = STM32_DDR_BASE;
size = 0;
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index 96ebc6d..26fe8b6 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -253,7 +253,7 @@ static int parse_type(struct stm32prog_data *data,
result = -EINVAL;
else
part->bin_nb =
- simple_strtoul(&p[7], NULL, 10);
+ dectoul(&p[7], NULL);
}
} else if (!strcmp(p, "System")) {
part->part_type = PART_SYSTEM;
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c
index 68a7a78..7a8ec7f 100644
--- a/arch/powerpc/cpu/mpc83xx/ecc.c
+++ b/arch/powerpc/cpu/mpc83xx/ecc.c
@@ -138,7 +138,7 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
}
if (argc == 3) {
if (strcmp(argv[1], "sbecnt") == 0) {
- val = simple_strtoul(argv[2], NULL, 10);
+ val = dectoul(argv[2], NULL);
if (val > 255) {
printf("Incorrect Counter value, "
"should be 0..255\n");
@@ -151,7 +151,7 @@ int do_ecc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
ddr->err_sbe = val;
return 0;
} else if (strcmp(argv[1], "sbethr") == 0) {
- val = simple_strtoul(argv[2], NULL, 10);
+ val = dectoul(argv[2], NULL);
if (val > 255) {
printf("Incorrect Counter value, "
"should be 0..255\n");