From: Andrew Lunn <andrew@lunn.ch>
To: yang.yang29@zte.com.cn
Cc: peppe.cavallaro@st.com, 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,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH linux-next v2] net: stmmac: use sysfs_streq() instead of strncmp()
Date: Tue, 29 Nov 2022 19:25:41 +0100 [thread overview]
Message-ID: <Y4ZOpQL3daLPqXXl@lunn.ch> (raw)
In-Reply-To: <202211291502286285262@zte.com.cn>
On Tue, Nov 29, 2022 at 03:02:28PM +0800, yang.yang29@zte.com.cn wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
>
> Replace the open-code with sysfs_streq().
>
> ---
> change for v2
> - fix the mistake of redundant parameter.
> - } else if (!strncmp(opt, "tc:", 3)) {
> + } else if (sysfs_streq(opt, "tc:")) {
> if (kstrtoint(opt + 3, 0, &tc))
> goto err;
Vladimir made the comment:
> What's even worse is that the patch is flat out wrong. The stmmac_cmdline_opt()
> function does not parse sysfs input, but cmdline input such as
> "stmmaceth=tc:1,pause:1". The pattern of using strsep() followed by
> strncmp() for such strings is not unique to stmmac, it can also be found
> mainly in drivers under drivers/video/fbdev/.
>
> With strncmp("tc:", 3), the code matches on the "tc:1" token properly.
> With sysfs_streq("tc:"), it doesn't.
It is not clear you have addressed this point.
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: yang.yang29@zte.com.cn
Cc: peppe.cavallaro@st.com, 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,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH linux-next v2] net: stmmac: use sysfs_streq() instead of strncmp()
Date: Tue, 29 Nov 2022 19:25:41 +0100 [thread overview]
Message-ID: <Y4ZOpQL3daLPqXXl@lunn.ch> (raw)
In-Reply-To: <202211291502286285262@zte.com.cn>
On Tue, Nov 29, 2022 at 03:02:28PM +0800, yang.yang29@zte.com.cn wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
>
> Replace the open-code with sysfs_streq().
>
> ---
> change for v2
> - fix the mistake of redundant parameter.
> - } else if (!strncmp(opt, "tc:", 3)) {
> + } else if (sysfs_streq(opt, "tc:")) {
> if (kstrtoint(opt + 3, 0, &tc))
> goto err;
Vladimir made the comment:
> What's even worse is that the patch is flat out wrong. The stmmac_cmdline_opt()
> function does not parse sysfs input, but cmdline input such as
> "stmmaceth=tc:1,pause:1". The pattern of using strsep() followed by
> strncmp() for such strings is not unique to stmmac, it can also be found
> mainly in drivers under drivers/video/fbdev/.
>
> With strncmp("tc:", 3), the code matches on the "tc:1" token properly.
> With sysfs_streq("tc:"), it doesn't.
It is not clear you have addressed this point.
Andrew
next prev parent reply other threads:[~2022-11-29 18:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 7:02 [PATCH linux-next v2] net: stmmac: use sysfs_streq() instead of strncmp() yang.yang29
2022-11-29 7:02 ` yang.yang29
2022-11-29 18:25 ` Andrew Lunn [this message]
2022-11-29 18:25 ` Andrew Lunn
2022-11-29 18:33 ` Vladimir Oltean
2022-11-29 18:33 ` Vladimir Oltean
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=Y4ZOpQL3daLPqXXl@lunn.ch \
--to=andrew@lunn.ch \
--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=vladimir.oltean@nxp.com \
--cc=xu.panda@zte.com.cn \
--cc=yang.yang29@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.