From patchwork Tue Nov 22 12:09:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yang X-Patchwork-Id: 24332 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2164986wrr; Tue, 22 Nov 2022 04:17:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf68T2jFRQLgnaGhUbjDd+vqaZpXUVCG5OUrHtOutntoNihzOe84vK2RAOiGLXDfIGmMoEiW X-Received: by 2002:a17:90a:dd83:b0:218:61bd:d00d with SMTP id l3-20020a17090add8300b0021861bdd00dmr28824329pjv.236.1669119461331; Tue, 22 Nov 2022 04:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669119461; cv=none; d=google.com; s=arc-20160816; b=PP4kjZqlxtZZMlGsRzq+1E7hvi3k4UWau1BHyzph1XDPp/9CgLsYe2h1ypdVmABOHS AuDLG+SAovTdkOBp8A39CitkCOxdGjg6mup6BH7805ICYwVhUU0M+VsSwG76/BmY7j5U 6QjsNYaRb+rP/56Po8BpSh514N5GTtCbbPQCuWT9msuiR8gPwRWa+zxaBWuaQQ4w4jKF 2wUqi5+jkTWQU0uQ3X+6HamsUPoxNUdPHxk3qf7lzHHqSZ9TksDvzlhvyM/94xh1DnoG WWV4oPbqu5d4GvZSf/Ss2W2c+/h+hpWCufrshJbJ8mdWPPDc0/YCFo2FY/u6MwacJiu+ 8i6A== 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=xPFgLEVLHtOtHSHo6+GivWhVTHjICAGfZEsthhH8DtQ=; b=dEjUPFYU1URUYw59bMK90FiX74BCBz14kNodC1AII2xJydeMKuqC4/Y5SHPt52WiUH zk6zHfyqkQzdpbG08SaFhd7mWACGqFeg8kYucJDkcueed691c7MD6crp6KWs+DX4P6Sp biRKpu8hyqQS3KMhQeo5GxA1eGRERwfsVUZiJWRNwYZerSjDl0kDwQqmK0vOAB0SCvnl OjRUabwXAxmNX7dOEr+qFyAUGgJzE0DkIhT5GcTQ07ttgqHC4EwHrM8zxm/zIxiMVeWB j1x8yyq/MQNv3hX08jgKRjAa9HooKrWp5plXCXIp6hTez7sSN9cDZucArf8SI8I8tKIe bB0g== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h64-20020a638343000000b004770fe93635si13239630pge.36.2022.11.22.04.17.27; Tue, 22 Nov 2022 04:17:41 -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 S233631AbiKVMJg (ORCPT + 99 others); Tue, 22 Nov 2022 07:09:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233597AbiKVMJa (ORCPT ); Tue, 22 Nov 2022 07:09:30 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFB349B4F; Tue, 22 Nov 2022 04:09:29 -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 4NGjjg5NNXz8QrkZ; Tue, 22 Nov 2022 20:09:27 +0800 (CST) Received: from szxlzmapp04.zte.com.cn ([10.5.231.166]) by mse-fl2.zte.com.cn with SMTP id 2AMC9KZH006279; Tue, 22 Nov 2022 20:09:20 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp02[null]) by mapi (Zmail) with MAPI id mid14; Tue, 22 Nov 2022 20:09:23 +0800 (CST) Date: Tue, 22 Nov 2022 20:09:23 +0800 (CST) X-Zmail-TransId: 2b04637cbbf3ffffffffe6ce2da8 X-Mailer: Zmail v1.0 Message-ID: <202211222009239312149@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_net=3A_stmmac=3A_use_sysfs=5Fstreq?= =?utf-8?q?=28=29_instead_of_strncmp=28=29?= X-MAIL: mse-fl2.zte.com.cn 2AMC9KZH006279 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 637CBBF7.000 by FangMail milter! X-FangMail-Envelope: 1669118967/4NGjjg5NNXz8QrkZ/637CBBF7.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 637CBBF7.000/4NGjjg5NNXz8QrkZ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750198608274704246?= X-GMAIL-MSGID: =?utf-8?q?1750198608274704246?= From: Xu Panda Replace the open-code with sysfs_streq(). 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..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; }