Skip to content

Commit ea2ab87

Browse files
cavagiudavem330
authored andcommitted
stmmac: do not use strict_strtoul but kstrtoint
This patch replaces the obsolete strict_strtoul with kstrtoint. v2: also removed casting on kstrtoul. v3: use kstrtoint instead of kstrtoul due to all vars are integer. thanks to E. Dumazet. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c801e3c commit ea2ab87

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,42 +2129,35 @@ static int __init stmmac_cmdline_opt(char *str)
21292129
return -EINVAL;
21302130
while ((opt = strsep(&str, ",")) != NULL) {
21312131
if (!strncmp(opt, "debug:", 6)) {
2132-
if (strict_strtoul(opt + 6, 0, (unsigned long *)&debug))
2132+
if (kstrtoint(opt + 6, 0, &debug))
21332133
goto err;
21342134
} else if (!strncmp(opt, "phyaddr:", 8)) {
2135-
if (strict_strtoul(opt + 8, 0,
2136-
(unsigned long *)&phyaddr))
2135+
if (kstrtoint(opt + 8, 0, &phyaddr))
21372136
goto err;
21382137
} else if (!strncmp(opt, "dma_txsize:", 11)) {
2139-
if (strict_strtoul(opt + 11, 0,
2140-
(unsigned long *)&dma_txsize))
2138+
if (kstrtoint(opt + 11, 0, &dma_txsize))
21412139
goto err;
21422140
} else if (!strncmp(opt, "dma_rxsize:", 11)) {
2143-
if (strict_strtoul(opt + 11, 0,
2144-
(unsigned long *)&dma_rxsize))
2141+
if (kstrtoint(opt + 11, 0, &dma_rxsize))
21452142
goto err;
21462143
} else if (!strncmp(opt, "buf_sz:", 7)) {
2147-
if (strict_strtoul(opt + 7, 0,
2148-
(unsigned long *)&buf_sz))
2144+
if (kstrtoint(opt + 7, 0, &buf_sz))
21492145
goto err;
21502146
} else if (!strncmp(opt, "tc:", 3)) {
2151-
if (strict_strtoul(opt + 3, 0, (unsigned long *)&tc))
2147+
if (kstrtoint(opt + 3, 0, &tc))
21522148
goto err;
21532149
} else if (!strncmp(opt, "watchdog:", 9)) {
2154-
if (strict_strtoul(opt + 9, 0,
2155-
(unsigned long *)&watchdog))
2150+
if (kstrtoint(opt + 9, 0, &watchdog))
21562151
goto err;
21572152
} else if (!strncmp(opt, "flow_ctrl:", 10)) {
2158-
if (strict_strtoul(opt + 10, 0,
2159-
(unsigned long *)&flow_ctrl))
2153+
if (kstrtoint(opt + 10, 0, &flow_ctrl))
21602154
goto err;
21612155
} else if (!strncmp(opt, "pause:", 6)) {
2162-
if (strict_strtoul(opt + 6, 0, (unsigned long *)&pause))
2156+
if (kstrtoint(opt + 6, 0, &pause))
21632157
goto err;
21642158
#ifdef CONFIG_STMMAC_TIMER
21652159
} else if (!strncmp(opt, "tmrate:", 7)) {
2166-
if (strict_strtoul(opt + 7, 0,
2167-
(unsigned long *)&tmrate))
2160+
if (kstrtoint(opt + 7, 0, &tmrate))
21682161
goto err;
21692162
#endif
21702163
}

0 commit comments

Comments
 (0)