From patchwork Mon Dec 2 07:49:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaolong Ye X-Patchwork-Id: 63470 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19EC9A04B5; Mon, 2 Dec 2019 09:04:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C028D1C0AC; Mon, 2 Dec 2019 08:59:01 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 921801C02B for ; Mon, 2 Dec 2019 08:58:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2019 23:58:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,268,1571727600"; d="scan'208";a="207993582" Received: from dpdk_yexl_af_xdp.sh.intel.com ([10.67.119.186]) by fmsmga008.fm.intel.com with ESMTP; 01 Dec 2019 23:58:48 -0800 From: Xiaolong Ye To: Beilei Xing , Qi Zhang Cc: dev@dpdk.org, Xiaolong Ye , Jeff Kirsher Date: Mon, 2 Dec 2019 15:49:08 +0800 Message-Id: <20191202074935.97629-43-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191202074935.97629-1-xiaolong.ye@intel.com> References: <20191202074935.97629-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH 42/69] net/i40e/base: change long redundant define names X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is no need to create define names that are practically a full sentence. If you want to describe in detail what the define is for, you a code comment. Define name can be abbreviated and should not contain verbs or "actions", so abbreviate as much as possible. These defines that were abbreviated could potentially get even shorter, but not without adequate code comments. Signed-off-by: Jeff Kirsher Reviewed-by: Aleksandr Loktionov Reviewed-by: Galazka Krzysztof Reviewed-by: Michael Alice Signed-off-by: Xiaolong Ye --- drivers/net/i40e/base/i40e_adminq_cmd.h | 6 +++--- drivers/net/i40e/base/i40e_common.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 2d1efef69..d5548792f 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -2282,18 +2282,18 @@ enum i40e_aq_phy_reg_type { struct i40e_aqc_run_phy_activity { u8 cmd_flags; __le16 activity_id; -#define I40E_AQ_RUN_PHY_ACTIVITY_ACTIVITY_ID_USER_DEFINED 0x10 +#define I40E_AQ_RUN_PHY_ACT_ID_USR_DFND 0x10 u8 reserved; union { struct { __le32 dnl_opcode; -#define I40E_AQ_RUN_PHY_ACTIVITY_DNL_OPCODE_GET_EEE_STATISTICS 0x801b +#define I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT 0x801b __le32 data; u8 reserved2[4]; } cmd; struct { __le32 cmd_status; -#define I40E_AQ_RUN_PHY_ACTIVITY_CMD_STATUS_SUCCESS 0x4 +#define I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC 0x4 __le32 data0; __le32 data1; } resp; diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index cedec4dce..91aa0f587 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -7182,11 +7182,11 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw, u32 cmd_status; retval = i40e_aq_run_phy_activity(hw, - I40E_AQ_RUN_PHY_ACTIVITY_ACTIVITY_ID_USER_DEFINED, - I40E_AQ_RUN_PHY_ACTIVITY_DNL_OPCODE_GET_EEE_STATISTICS, - &cmd_status, tx_counter, rx_counter, NULL); + I40E_AQ_RUN_PHY_ACT_ID_USR_DFND, + I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT, + &cmd_status, tx_counter, rx_counter, NULL); - if (cmd_status != I40E_AQ_RUN_PHY_ACTIVITY_CMD_STATUS_SUCCESS) + if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC) retval = I40E_ERR_ADMIN_QUEUE_ERROR; return retval;