From: <yang.yang29@zte.com.cn>
To: <peppe.cavallaro@st.com>
Cc: <alexandre.torgue@foss.st.com>, <joabreu@synopsys.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <mcoquelin.stm32@gmail.com>,
<netdev@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <xu.panda@zte.com.cn>,
<yang.yang29@zte.com.cn>
Subject: [PATCH linux-next] net: stmmac: use sysfs_streq() instead of strncmp()
Date: Tue, 22 Nov 2022 20:09:23 +0800 (CST) [thread overview]
Message-ID: <202211222009239312149@zte.com.cn> (raw)
From: Xu Panda <xu.panda@zte.com.cn>
Replace the open-code with sysfs_streq().
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 0a9d13d7976f..4167e768a86a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7562,31 +7562,31 @@ static int __init stmmac_cmdline_opt(char *str)
if (!str || !*str)
return 1;
while ((opt = strsep(&str, ",")) != NULL) {
- if (!strncmp(opt, "debug:", 6)) {
+ if (sysfs_streq(opt, "debug:")) {
if (kstrtoint(opt + 6, 0, &debug))
goto err;
- } else if (!strncmp(opt, "phyaddr:", 8)) {
+ } else if (sysfs_streq(opt, "phyaddr:")) {
if (kstrtoint(opt + 8, 0, &phyaddr))
goto err;
- } else if (!strncmp(opt, "buf_sz:", 7)) {
+ } else if (sysfs_streq(opt, "buf_sz:")) {
if (kstrtoint(opt + 7, 0, &buf_sz))
goto err;
- } else if (!strncmp(opt, "tc:", 3)) {
+ } else if (sysfs_streq(opt, "tc:")) {
if (kstrtoint(opt + 3, 0, &tc))
goto err;
- } else if (!strncmp(opt, "watchdog:", 9)) {
+ } else if (sysfs_streq(opt, "watchdog:")) {
if (kstrtoint(opt + 9, 0, &watchdog))
goto err;
- } else if (!strncmp(opt, "flow_ctrl:", 10)) {
+ } else if (sysfs_streq(opt, "flow_ctrl:")) {
if (kstrtoint(opt + 10, 0, &flow_ctrl))
goto err;
- } else if (!strncmp(opt, "pause:", 6)) {
+ } else if (sysfs_streq(opt, "pause:", 6)) {
if (kstrtoint(opt + 6, 0, &pause))
goto err;
- } else if (!strncmp(opt, "eee_timer:", 10)) {
+ } else if (sysfs_streq(opt, "eee_timer:")) {
if (kstrtoint(opt + 10, 0, &eee_timer))
goto err;
- } else if (!strncmp(opt, "chain_mode:", 11)) {
+ } else if (sysfs_streq(opt, "chain_mode:")) {
if (kstrtoint(opt + 11, 0, &chain_mode))
goto err;
}
--
2.15.2
next reply other threads:[~2022-11-22 12:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 12:09 yang.yang29 [this message]
2022-11-25 8:10 ` [PATCH linux-next] net: stmmac: use sysfs_streq() instead of strncmp() patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202211222009239312149@zte.com.cn \
--to=yang.yang29@zte.com.cn \
--cc=alexandre.torgue@foss.st.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=xu.panda@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).