Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1255724rwb; Tue, 29 Nov 2022 10:56:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LifwXsh6R0Hk/p8IQKrI1yMb7CFy0iiKjMy3/qsiCodtJd9xNp3+gg6Sc5ENj3dkIWOVI X-Received: by 2002:a17:902:e94e:b0:186:5613:becf with SMTP id b14-20020a170902e94e00b001865613becfmr26757137pll.46.1669748187201; Tue, 29 Nov 2022 10:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669748187; cv=none; d=google.com; s=arc-20160816; b=QubwCQSrdkZnr7pugSgnX5U1enjRhs6Gfc7tCu86jtCzJoMp2NvOweEQ/ZHchIgjf6 kmZ8CuUJbDjryAlUYF9irPFPDxAxQOtkjhvaZZs4i63puN81n6LjPhY9ssWKtrjaosG9 +bOFqKGutnUIsPZfuO9PJ74/VQJp9qMhJXOZNoDSlImSvr5pFMdT8Ym3gzsNhMjzUPKa f5OqqbBCfDsNMcM0GhrJg+Jse7rZ140yN22+34DiwOqVoDosOgv/KpRKs/MZ8dQY5GaI wqRYzVUvx+cTJo7jw6VRZvtS8eoE1SIsd1lbo6AfYivaNYkIOezwfnu6fTouVwSdC8GD tplA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cy0Wc6FUl5cpTdVMiVOmfG61yLTXh8RJczd8KP8IoZA=; b=Y/+EiSBvFE6Vvb89ytZtebSp5FgVx79DuxnU5HGNUOkU+xJwbrlxIissXtdfdSeKfj FSOd1x8wBYjY55FAexWWvtlbDhw7mBm5IFEtXT9y29Rfb+cZvi1Io2qoLlqp+W9JHlDw 0/6Cyg0OsKANfY84SsPApa3moYTN2m2I/CXWb0GojfStrBMlORIYOPdUqs/oUtRm6HgL ewqZ9A6SLhmDaTrtsb7Ylto440l2GiQ0rumwemKJi0RFFR/BRkSPJyZeIAMVstRQWWyM 4RswUTLY2jBp6ZxxrhHI8RyOENHZXPWUV9TS6bDNMSw04yBgkBavrJ863vmsyVxZs6Ha jXEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=keVuLupj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb12-20020a17090ae7cc00b0020d4b43d8b5si2465579pjb.103.2022.11.29.10.56.12; Tue, 29 Nov 2022 10:56:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=keVuLupj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235850AbiK2S0h (ORCPT + 84 others); Tue, 29 Nov 2022 13:26:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235838AbiK2S0Y (ORCPT ); Tue, 29 Nov 2022 13:26:24 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701D964555; Tue, 29 Nov 2022 10:26:19 -0800 (PST) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202211291502286285262@zte.com.cn> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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