Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp940194ybl; Wed, 28 Aug 2019 07:29:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS3hBlYE4yxrk1Lk98PCEkFBeGJiZIgZnQY2FRLURBjEv/UPfXiW/VURawMJLo/tUvzNZ5 X-Received: by 2002:aa7:842f:: with SMTP id q15mr4990889pfn.250.1567002555391; Wed, 28 Aug 2019 07:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567002555; cv=none; d=google.com; s=arc-20160816; b=kgRorAaA2epYSd7exQHfT76qmTDhkgbuKFEmjm/hykdEKGT/NAtd4vpcznydUDjtra 3q0zNOzYWOSLXnaulBQYsh2EqwZsYJL0yho3BZ3+/R9qGiAwcusuGVsik/Exikjj15KH Z19vxWMXprquvZtBiTONsiJCq2RfNpycjvImbRotV4jLolOswPlLiR0Knx5o6O1vYdw4 e7O6KkBRX61jKnt6VO78L/jjcypYzuboa3cbcaOJ7i3JDQS3EySpARxjYEzx7+6FfawZ rpAoBJ8aNVlG0hD3WZiyExzL7tyiVUSC7YQmJWcGPbpuXHf0uK+Gf20wfe4T9P/7P05p AZ2g== 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=8fRsl5jGgsthmVglF8/7DOIeHUK1H67qPae27VmIAtc=; b=Mgzfi4JoQsQTwom2HotLr4fsE4ltX5CQXjfL2CwtZ+eBz5Wyu+bym2Mbcav328+UKP jWfiveM3Z9Nbqsh9x6QN+THHv1x9/O0CnR/N7xoEa/YykRcv6i+3O0gmhIhTwD5F/78z 9fZA2tdlFvZ3a0IaXzlDUbZCt0L6H0c/C131TPspJ/cbD+caBi8Vi+69FOsUfz6ebwVp eanG52CWepeg/DUnrO6DGT0x51RwAXFp9DJjjpl+y5z81CrKRKtiJ93C5MW1lNZR1MMQ qloGBlaLxQH39WaaWp+3GkHyXNHN3PZlKliCBpjz4bY90CHk5HHqNy76W8MXleY/Crmf 61gQ== 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 k16si1119987pll.201.2019.08.28.07.28.59; Wed, 28 Aug 2019 07:29:15 -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 S1726560AbfH1OZj (ORCPT + 99 others); Wed, 28 Aug 2019 10:25:39 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5232 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726341AbfH1OZj (ORCPT ); Wed, 28 Aug 2019 10:25:39 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 20AAF72F76A31012F689; 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 02/12] net: hns3: use macro instead of magic number Date: Wed, 28 Aug 2019 22:23:06 +0800 Message-ID: <1567002196-63242-3-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 uses macro to replace some magic number. Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 6 ++++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h | 3 ++- 2 files changed, 6 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 a56f388..3b4cd23 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -774,7 +774,8 @@ static void hclge_dbg_dump_qos_buf_cfg(struct hclge_dev *hdev) rx_priv_wl = (struct hclge_rx_priv_wl_buf *)desc[1].data; for (i = 0; i < HCLGE_TC_NUM_ONE_DESC; i++) dev_info(&hdev->pdev->dev, - "rx_priv_wl_tc_%d: high: 0x%x, low: 0x%x\n", i + 4, + "rx_priv_wl_tc_%d: high: 0x%x, low: 0x%x\n", + i + HCLGE_TC_NUM_ONE_DESC, rx_priv_wl->tc_wl[i].high, rx_priv_wl->tc_wl[i].low); cmd = HCLGE_OPC_RX_COM_THRD_ALLOC; @@ -796,7 +797,8 @@ static void hclge_dbg_dump_qos_buf_cfg(struct hclge_dev *hdev) rx_com_thrd = (struct hclge_rx_com_thrd *)desc[1].data; for (i = 0; i < HCLGE_TC_NUM_ONE_DESC; i++) dev_info(&hdev->pdev->dev, - "rx_com_thrd_tc_%d: high: 0x%x, low: 0x%x\n", i + 4, + "rx_com_thrd_tc_%d: high: 0x%x, low: 0x%x\n", + i + HCLGE_TC_NUM_ONE_DESC, rx_com_thrd->com_thrd[i].high, rx_com_thrd->com_thrd[i].low); return; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h index 80e5cc2..38b7932 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h @@ -72,9 +72,10 @@ struct hclge_dbg_reg_common_msg { enum hclge_opcode_type cmd; }; +#define HCLGE_DBG_MAX_DFX_MSG_LEN 60 struct hclge_dbg_dfx_message { int flag; - char message[60]; + char message[HCLGE_DBG_MAX_DFX_MSG_LEN]; }; #define HCLGE_DBG_MAC_REG_TYPE_LEN 32 -- 2.7.4