Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp940702ybl; Wed, 28 Aug 2019 07:29:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYFbpG8u0hm8zXzDdWYrmlU1Rw4I9P9aMgKOeF2mo84eGvxs+sNELyJlw8KUP+UFtVT9Jc X-Received: by 2002:a17:902:3265:: with SMTP id y92mr3243397plb.343.1567002579698; Wed, 28 Aug 2019 07:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567002579; cv=none; d=google.com; s=arc-20160816; b=v0ByHZaGP4FktLhSZvcgNoSp2CY2mE0unWESUz/95/C9+K//5pi7GAONGJgUBe0XkT 1fgM406re7scQlOQNxBP9Ndy32WQa6h9SVkoHFHir52MfIUAZFXCZhNJsqb44vok58NT Xagduo0ZBvCJrycqE5CAgC2NVw3an3qlV+TfInI/6U0xfiLAY+wyzIGIIIg/k41ErEVa FF72xb/fjsr4puGhflxjO/blTqBA610DTdpS3KxTovrFuMhrMEv67x76vcJ1We9r/FeQ Tj72pRP+OZFq8/lAwMvez9+nM44WDsPYi6pq6W7Hj0MxTc0kEcUc1LUfQQ8VlCzAZuVg 7e4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=zB4v6ieSjl4D+gcEZrjT2Dyg33dZZNXwzpbJ1cHmsmk=; b=z9pX8JknZVo0+rKfq9PeHPeOt4F/ajnVoIK7KHdtYqlewV6mNKumwxiCbor0fU3qGn 9O8dA0z4tFZVfNWvGSmrusuvkzpEU+486xoCgBBKxKUcq38IpP1EXnAtmMEFKZtWw3Sg dAPLamMGcaYWuXr0Q9mSiWWNLR+dUJdxK6EAx6iT3u8RK5bverDEXRbaAEettHCCN6f3 swfA/d3zsux9jxxJ0eLz1z9jQC/UZkqEmn1SN5X5rjQ2ghJTiR5FHMPq1BaSAC5mW/cR 7dWiJt47zptd6atNq09Zu8vjqDbjIEgCiCLrkBkTmnTq/YHOyMudmvtnyeLKtUKCvgbG dDpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si2229040pgp.391.2019.08.28.07.29.23; Wed, 28 Aug 2019 07:29:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbfH1O0i (ORCPT + 99 others); Wed, 28 Aug 2019 10:26:38 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5234 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726691AbfH1OZk (ORCPT ); Wed, 28 Aug 2019 10:25:40 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1825CCC0AA225B890167; Wed, 28 Aug 2019 22:25:36 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 28 Aug 2019 22:25:30 +0800 From: Huazhong Tan To: CC: , , , , , Huazhong Tan Subject: [PATCH net-next 03/12] net: hns3: modify base parameter of kstrtouint in hclge_dbg_dump_tm_map Date: Wed, 28 Aug 2019 22:23:07 +0800 Message-ID: <1567002196-63242-4-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567002196-63242-1-git-send-email-tanhuazhong@huawei.com> References: <1567002196-63242-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces kstrtouint()'s patameter base with 0 in the hclge_dbg_dump_tm_mac(), which makes it more flexible. Also uses a macro to replace string "dump tm map", since it has been used multiple times. Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c index 3b4cd23..0639250 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -564,7 +564,7 @@ static void hclge_dbg_dump_tm_map(struct hclge_dev *hdev, int pri_id, ret; u32 i; - ret = kstrtouint(&cmd_buf[12], 10, &queue_id); + ret = kstrtouint(cmd_buf, 0, &queue_id); queue_id = (ret != 0) ? 0 : queue_id; cmd = HCLGE_OPC_TM_NQ_TO_QS_LINK; @@ -1099,6 +1099,7 @@ static void hclge_dbg_dump_mac_tnl_status(struct hclge_dev *hdev) int hclge_dbg_run_cmd(struct hnae3_handle *handle, const char *cmd_buf) { #define DUMP_REG "dump reg" +#define DUMP_TM_MAP "dump tm map" struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_dev *hdev = vport->back; @@ -1107,8 +1108,8 @@ int hclge_dbg_run_cmd(struct hnae3_handle *handle, const char *cmd_buf) hclge_dbg_fd_tcam(hdev); } else if (strncmp(cmd_buf, "dump tc", 7) == 0) { hclge_dbg_dump_tc(hdev); - } else if (strncmp(cmd_buf, "dump tm map", 11) == 0) { - hclge_dbg_dump_tm_map(hdev, cmd_buf); + } else if (strncmp(cmd_buf, DUMP_TM_MAP, strlen(DUMP_TM_MAP)) == 0) { + hclge_dbg_dump_tm_map(hdev, &cmd_buf[sizeof(DUMP_TM_MAP)]); } else if (strncmp(cmd_buf, "dump tm", 7) == 0) { hclge_dbg_dump_tm(hdev); } else if (strncmp(cmd_buf, "dump qos pause cfg", 18) == 0) { -- 2.7.4