From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7FDD458CD; Mon, 2 Sep 2024 11:57:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D7E240B8C; Mon, 2 Sep 2024 11:55:37 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by mails.dpdk.org (Postfix) with ESMTP id B5D4540669 for ; Mon, 2 Sep 2024 11:55:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725270915; x=1756806915; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IHNQnj1woTkl4HXWIzR6TrITzcCEUGBrnjbaR7dz4Bs=; b=VyZT8Spf5JC/GROmWo18YbI3BLySBeNlRkTxKloyV0zu1T2Ug5Y1N4Un JXwbSD5o93YQX1DWBjP0ObAldy8T/XewKo/uxbpG32sm26A/xvqWv3x7C pTgahFAGy2J0c4nwB1OARtTELBDdZcjoTDax+nkc+jPVjx/UeWBZUXDfo ivkBkXTH2jdt2fJvckEICNqFonsekmZ+OZg8n+8Fb7lw1BtNqvOepKFbz YSbuQekzy6sszK6ATXg0cuFj9XKT+WAoN8C2IwIZBIngAunhlA79tXNFC flXna04IkaCs12VS1SLAilQjtG2pN5MtLTKa65U+SUCdfSLUQG33tU5Qg w==; X-CSE-ConnectionGUID: I78g+v28R3SC29YlGinImQ== X-CSE-MsgGUID: psz7LeDHQZOiMr5G6WrEzQ== X-IronPort-AV: E=McAfee;i="6700,10204,11182"; a="26747222" X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="26747222" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2024 02:55:14 -0700 X-CSE-ConnectionGUID: qrX8/R0WTyiszjIj4ZIFHA== X-CSE-MsgGUID: 1LyUaeAcQPm+PBjse/NtrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,195,1719903600"; d="scan'208";a="64597940" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa009.fm.intel.com with ESMTP; 02 Sep 2024 02:55:14 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: bruce.richardson@intel.com Subject: [PATCH v1 17/30] net/i40e/base: improve typecasting Date: Mon, 2 Sep 2024 10:54:29 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Vignesh Sridhar Adding typecast to variables to avoid compiler warnings generated on certain platforms and compilers if variables of a particular data type are assigned to ones of a smaller data type. Signed-off-by: Vignesh Sridhar Signed-off-by: Anatoly Burakov --- drivers/net/i40e/base/i40e_common.c | 6 +++--- drivers/net/i40e/base/i40e_dcb.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 693608ac99..416f31dcc3 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -4253,7 +4253,7 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, */ if (hw->num_ports != 0) { hw->partition_id = (hw->pf_id / hw->num_ports) + 1; - hw->num_partitions = num_functions / hw->num_ports; + hw->num_partitions = (u16)(num_functions / hw->num_ports); } /* additional HW specific goodies that might @@ -6180,7 +6180,7 @@ enum i40e_status_code i40e_aq_alternate_write_indirect(struct i40e_hw *hw, cmd_resp->length = CPU_TO_LE32(dw_count); status = i40e_asq_send_command(hw, &desc, buffer, - I40E_LO_DWORD(4*dw_count), NULL); + I40E_LO_WORD(4*dw_count), NULL); return status; } @@ -6261,7 +6261,7 @@ enum i40e_status_code i40e_aq_alternate_read_indirect(struct i40e_hw *hw, cmd_resp->length = CPU_TO_LE32(dw_count); status = i40e_asq_send_command(hw, &desc, buffer, - I40E_LO_DWORD(4*dw_count), NULL); + I40E_LO_WORD(4*dw_count), NULL); return status; } diff --git a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c index de0320bf3f..04322ea034 100644 --- a/drivers/net/i40e/base/i40e_dcb.c +++ b/drivers/net/i40e/base/i40e_dcb.c @@ -906,7 +906,7 @@ enum i40e_status_code i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change) return I40E_ERR_NOT_READY; /* Get the LLDP AdminStatus for the current port */ - adminstatus = lldp_cfg.adminstatus >> (hw->port * 4); + adminstatus = (u8)(lldp_cfg.adminstatus >> (hw->port * 4)); adminstatus &= 0xF; /* LLDP agent disabled */ -- 2.43.5