Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3240e28 authored by Giuseppe CAVALLARO's avatar Giuseppe CAVALLARO Committed by David S. Miller
Browse files

stmmac: remove warning when compile as built-in (V2)



The patch removes the following serie of warnings
when the driver is compiled as built-in:

drivers/net/stmmac/stmmac_main.c: In function stmmac_cmdline_opt:
drivers/net/stmmac/stmmac_main.c:1855:12: warning: ignoring return
value of kstrtoul, declared with attribute warn_unused_result
[snip]

Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3bec5dcc
Loading
Loading
Loading
Loading
+42 −23
Original line number Original line Diff line number Diff line
@@ -1917,33 +1917,52 @@ static int __init stmmac_cmdline_opt(char *str)
	if (!str || !*str)
	if (!str || !*str)
		return -EINVAL;
		return -EINVAL;
	while ((opt = strsep(&str, ",")) != NULL) {
	while ((opt = strsep(&str, ",")) != NULL) {
		if (!strncmp(opt, "debug:", 6))
		if (!strncmp(opt, "debug:", 6)) {
			strict_strtoul(opt + 6, 0, (unsigned long *)&debug);
			if (strict_strtoul(opt + 6, 0, (unsigned long *)&debug))
		else if (!strncmp(opt, "phyaddr:", 8))
				goto err;
			strict_strtoul(opt + 8, 0, (unsigned long *)&phyaddr);
		} else if (!strncmp(opt, "phyaddr:", 8)) {
		else if (!strncmp(opt, "dma_txsize:", 11))
			if (strict_strtoul(opt + 8, 0,
			strict_strtoul(opt + 11, 0,
					   (unsigned long *)&phyaddr))
				       (unsigned long *)&dma_txsize);
				goto err;
		else if (!strncmp(opt, "dma_rxsize:", 11))
		} else if (!strncmp(opt, "dma_txsize:", 11)) {
			strict_strtoul(opt + 11, 0,
			if (strict_strtoul(opt + 11, 0,
				       (unsigned long *)&dma_rxsize);
					   (unsigned long *)&dma_txsize))
		else if (!strncmp(opt, "buf_sz:", 7))
				goto err;
			strict_strtoul(opt + 7, 0, (unsigned long *)&buf_sz);
		} else if (!strncmp(opt, "dma_rxsize:", 11)) {
		else if (!strncmp(opt, "tc:", 3))
			if (strict_strtoul(opt + 11, 0,
			strict_strtoul(opt + 3, 0, (unsigned long *)&tc);
					   (unsigned long *)&dma_rxsize))
		else if (!strncmp(opt, "watchdog:", 9))
				goto err;
			strict_strtoul(opt + 9, 0, (unsigned long *)&watchdog);
		} else if (!strncmp(opt, "buf_sz:", 7)) {
		else if (!strncmp(opt, "flow_ctrl:", 10))
			if (strict_strtoul(opt + 7, 0,
			strict_strtoul(opt + 10, 0,
					   (unsigned long *)&buf_sz))
				       (unsigned long *)&flow_ctrl);
				goto err;
		else if (!strncmp(opt, "pause:", 6))
		} else if (!strncmp(opt, "tc:", 3)) {
			strict_strtoul(opt + 6, 0, (unsigned long *)&pause);
			if (strict_strtoul(opt + 3, 0, (unsigned long *)&tc))
				goto err;
		} else if (!strncmp(opt, "watchdog:", 9)) {
			if (strict_strtoul(opt + 9, 0,
					   (unsigned long *)&watchdog))
				goto err;
		} else if (!strncmp(opt, "flow_ctrl:", 10)) {
			if (strict_strtoul(opt + 10, 0,
					   (unsigned long *)&flow_ctrl))
				goto err;
		} else if (!strncmp(opt, "pause:", 6)) {
			if (strict_strtoul(opt + 6, 0, (unsigned long *)&pause))
				goto err;
#ifdef CONFIG_STMMAC_TIMER
#ifdef CONFIG_STMMAC_TIMER
		else if (!strncmp(opt, "tmrate:", 7))
		} else if (!strncmp(opt, "tmrate:", 7)) {
			strict_strtoul(opt + 7, 0, (unsigned long *)&tmrate);
			if (strict_strtoul(opt + 7, 0,
					   (unsigned long *)&tmrate))
				goto err;
#endif
#endif
		}
		}
	}
	return 0;
	return 0;

err:
	pr_err("%s: ERROR broken module parameter conversion", __func__);
	return -EINVAL;
}
}


__setup("stmmaceth=", stmmac_cmdline_opt);
__setup("stmmaceth=", stmmac_cmdline_opt);