Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp407685rwb; Mon, 28 Nov 2022 23:32:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4XCOzca6x95RLGrwbvur2zgCYJAgrp6ZYzGC1JvMlp5jBqH8fwZK+qGyB8YNn6UmH9K3Nt X-Received: by 2002:a17:906:f114:b0:7c0:7d70:facd with SMTP id gv20-20020a170906f11400b007c07d70facdmr5215583ejb.645.1669707168322; Mon, 28 Nov 2022 23:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669707168; cv=none; d=google.com; s=arc-20160816; b=zDiG1EdRSOsmc2eMK0mhVjYY6mElbLBbzNHiQ7SSsPsiFz4eEAawyA+32FBdo9GYqA GfWTdE+l58FpGt6LpBrwqhlHFctn2P9HVfsk2ZQdvqBB4zXdU8F7Q5TRGl2TPxPD75yM s2UeIjxAhIobdLx6Iznhws28HdlQjpR7IWlXFDmng7IQu1sriNXVM3xSQnmOOVpo/rOC Fy0NzEM6yOwttjKz/zwb3tJa1a0v/PmsOXOz9kQ9VeoHelx3Agacm7JhlXDncAtDJm8b fXAQNa9c1T6JaBxsloFlk4xEjjX9JQMhQWNWDMNIe5Wvm58CfI2ey5rO1O35SaNrnwfu yPOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=iRzqSX8L/RuxAu45bFzGVqYrE50M3hTc4yq8qJPskC8=; b=HZ5MmXFA5QnEBRD2u2ddDfbTu6cByivjgidI5tb9ScuLIUO38hDIwHNBtRlnToJDgj f0Jtzwt2nAWW5BtvlVjigkHjLnI+m2ZqnGVIwn0heVXn92h+qJ2nQa43FPettm3XjJhj eaoebYBizgVjD+Jhkb4J7xwEzU8RMQr9dpJcV8ZvY4kmvPTpSE1kzPTffreufM00VC51 Jd1RkYtQPvqgTMZMk3kw7aWcrLdEBne0QibIZNt6L6jM2p42qML/Mn+CCbgZIB8vicxC sf3PlsVnlyB8fRHNkzdk8/ubHRdmlkLhJ4ymdPW0XjOwPvUs0149Hvzn2UwkrEPn/Jcj 3Ugw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt7-20020a0564020a4700b00461a32e0e38si10373560edb.306.2022.11.28.23.32.28; Mon, 28 Nov 2022 23:32:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbiK2HCo (ORCPT + 82 others); Tue, 29 Nov 2022 02:02:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiK2HCl (ORCPT ); Tue, 29 Nov 2022 02:02:41 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B450711812; Mon, 28 Nov 2022 23:02:37 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NLtZL6Kz8z4xVnd; Tue, 29 Nov 2022 15:02:34 +0800 (CST) Received: from szxlzmapp02.zte.com.cn ([10.5.231.79]) by mse-fl2.zte.com.cn with SMTP id 2AT71vsp049656; Tue, 29 Nov 2022 15:02:26 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Tue, 29 Nov 2022 15:02:28 +0800 (CST) Date: Tue, 29 Nov 2022 15:02:28 +0800 (CST) X-Zmail-TransId: 2b046385ae847e71f525 X-Mailer: Zmail v1.0 Message-ID: <202211291502286285262@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIGxpbnV4LW5leHQgdjJdIG5ldDogc3RtbWFjOiB1c2Ugc3lzZnNfc3RyZXEoKSBpbnN0ZWFkIG9mIHN0cm5jbXAoKQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AT71vsp049656 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 6385AE8A.000 by FangMail milter! X-FangMail-Envelope: 1669705354/4NLtZL6Kz8z4xVnd/6385AE8A.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6385AE8A.000/4NLtZL6Kz8z4xVnd X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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 From: Xu Panda Replace the open-code with sysfs_streq(). --- change for v2 - fix the mistake of redundant parameter. --- Signed-off-by: Xu Panda Signed-off-by: Yang Yang --- 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..5ec9f64dadd0 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:")) { 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