From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE764C433FE for ; Tue, 29 Nov 2022 18:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B2sBupW/qhaTQb67Yh1aZ0KImpWKO3afE4MbP7s74jo=; b=xMkw8P7BcPy1ai /GqoS3Hnxr13MmRz3dA2a2xFRgBk6XRoEnVdv5EypI0ULrdFGep7uzxgdaUp5yjcFVOjQSeYFRx5s 4yd+iuBw63++rxS+I/apVN4AkQfxIGHc49p5/AsvZpvOHj7XlP86oon73kpIQ7DQ0ah//RhjUAeBe j3w8o7lP201/N4+1TgsrjPQ567AJ8PxL/NIfp3XKWJ6Md7DMUsJmIfZVeIvqd32q9vEVhE+KG8xRZ qqu7CT+rx+UQt5eVtT6BUkIkz+VkOgVq0Y1E9ovQUCKAZX723sdum/ix71OIOMUFW4lik/WwLFG5C ZP34MOgm8f/qnRH38uAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p05JJ-00AmrO-4C; Tue, 29 Nov 2022 18:26:25 +0000 Received: from vps0.lunn.ch ([156.67.10.101]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p05JG-00AmqI-09 for linux-arm-kernel@lists.infradead.org; Tue, 29 Nov 2022 18:26:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=cy0Wc6FUl5cpTdVMiVOmfG61yLTXh8RJczd8KP8IoZA=; b=keVuLupjCmT6F9EPe36KrGtKkD LG5B2kQ3QljwPULHTAUg4iugMd1EkEVtyt2Jav4kfKeTdbsPdpp/svvkSm14nJG7SKd0vEJUMYC+y RvAMNfCW51VkEyDSO04sth7+Bs+os9FqGE0LnCC0uZGjwmojEWMmD5FTI0rii0WD8tPw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p05Ib-003twF-QX; Tue, 29 Nov 2022 19:25:41 +0100 Date: Tue, 29 Nov 2022 19:25:41 +0100 From: Andrew Lunn 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 Subject: Re: [PATCH linux-next v2] net: stmmac: use sysfs_streq() instead of strncmp() Message-ID: References: <202211291502286285262@zte.com.cn> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202211291502286285262@zte.com.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221129_102622_082722_99EF6C3E X-CRM114-Status: GOOD ( 14.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 29, 2022 at 03:02:28PM +0800, yang.yang29@zte.com.cn wrote: > From: Xu Panda > > 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