Commit f72cd76b authored by Xu Panda's avatar Xu Panda Committed by David S. Miller

net: stmmac: use sysfs_streq() instead of strncmp()

Replace the open-code with sysfs_streq().
Signed-off-by: default avatarXu Panda <xu.panda@zte.com.cn>
Signed-off-by: default avatarYang Yang <yang.yang29@zte.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 813abcd9
...@@ -7562,31 +7562,31 @@ static int __init stmmac_cmdline_opt(char *str) ...@@ -7562,31 +7562,31 @@ static int __init stmmac_cmdline_opt(char *str)
if (!str || !*str) if (!str || !*str)
return 1; return 1;
while ((opt = strsep(&str, ",")) != NULL) { while ((opt = strsep(&str, ",")) != NULL) {
if (!strncmp(opt, "debug:", 6)) { if (sysfs_streq(opt, "debug:")) {
if (kstrtoint(opt + 6, 0, &debug)) if (kstrtoint(opt + 6, 0, &debug))
goto err; goto err;
} else if (!strncmp(opt, "phyaddr:", 8)) { } else if (sysfs_streq(opt, "phyaddr:")) {
if (kstrtoint(opt + 8, 0, &phyaddr)) if (kstrtoint(opt + 8, 0, &phyaddr))
goto err; goto err;
} else if (!strncmp(opt, "buf_sz:", 7)) { } else if (sysfs_streq(opt, "buf_sz:")) {
if (kstrtoint(opt + 7, 0, &buf_sz)) if (kstrtoint(opt + 7, 0, &buf_sz))
goto err; goto err;
} else if (!strncmp(opt, "tc:", 3)) { } else if (sysfs_streq(opt, "tc:")) {
if (kstrtoint(opt + 3, 0, &tc)) if (kstrtoint(opt + 3, 0, &tc))
goto err; goto err;
} else if (!strncmp(opt, "watchdog:", 9)) { } else if (sysfs_streq(opt, "watchdog:")) {
if (kstrtoint(opt + 9, 0, &watchdog)) if (kstrtoint(opt + 9, 0, &watchdog))
goto err; goto err;
} else if (!strncmp(opt, "flow_ctrl:", 10)) { } else if (sysfs_streq(opt, "flow_ctrl:")) {
if (kstrtoint(opt + 10, 0, &flow_ctrl)) if (kstrtoint(opt + 10, 0, &flow_ctrl))
goto err; goto err;
} else if (!strncmp(opt, "pause:", 6)) { } else if (sysfs_streq(opt, "pause:", 6)) {
if (kstrtoint(opt + 6, 0, &pause)) if (kstrtoint(opt + 6, 0, &pause))
goto err; goto err;
} else if (!strncmp(opt, "eee_timer:", 10)) { } else if (sysfs_streq(opt, "eee_timer:")) {
if (kstrtoint(opt + 10, 0, &eee_timer)) if (kstrtoint(opt + 10, 0, &eee_timer))
goto err; goto err;
} else if (!strncmp(opt, "chain_mode:", 11)) { } else if (sysfs_streq(opt, "chain_mode:")) {
if (kstrtoint(opt + 11, 0, &chain_mode)) if (kstrtoint(opt + 11, 0, &chain_mode))
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment