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 1A6F7A0C45 for ; Thu, 10 Jun 2021 14:07:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1373940FDF; Thu, 10 Jun 2021 14:07:12 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 22F054069B for ; Thu, 10 Jun 2021 14:07:11 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lrJSo-0008WH-Gg; Thu, 10 Jun 2021 12:07:10 +0000 From: Christian Ehrhardt To: Michal Krawczyk Cc: Igor Chauskin , Guy Tzalik , dpdk stable Date: Thu, 10 Jun 2021 14:06:01 +0200 Message-Id: <20210610120641.885862-13-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610120641.885862-1-christian.ehrhardt@canonical.com> References: <20210610120641.885862-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ena/base: fix type conversions by explicit casting' has been queued to stable release 19.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/0731d405e92051ddb5f7c1a11c260efdaf4f69e7 Thanks. Christian Ehrhardt --- >From 0731d405e92051ddb5f7c1a11c260efdaf4f69e7 Mon Sep 17 00:00:00 2001 From: Michal Krawczyk Date: Tue, 11 May 2021 08:45:40 +0200 Subject: [PATCH] net/ena/base: fix type conversions by explicit casting [ upstream commit 83e8d5378d3f2eef749d47bb1145c29cc797a277 ] To silence error messages from the static code analysis, make the type conversions explicit where they're intended. Also fix the type for the DMA width value. Fixes: 99ecfbf845b3 ("ena: import communication layer") Signed-off-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Guy Tzalik --- drivers/net/ena/base/ena_com.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index f8e8f448e3..50b39b88ba 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -1340,7 +1340,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue, ena_trc_err("Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); - return PTR_ERR(comp_ctx); + return (int)PTR_ERR(comp_ctx); } ret = ena_com_wait_and_process_admin_cq(comp_ctx, admin_queue); @@ -1559,7 +1559,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) int ena_com_get_dma_width(struct ena_com_dev *ena_dev) { u32 caps = ena_com_reg_bar_read32(ena_dev, ENA_REGS_CAPS_OFF); - int width; + u32 width; if (unlikely(caps == ENA_MMIO_READ_TIMEOUT)) { ena_trc_err("Reg read timeout occurred\n"); @@ -2263,7 +2263,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu) cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; cmd.aq_common_descriptor.flags = 0; cmd.feat_common.feature_id = ENA_ADMIN_MTU; - cmd.u.mtu.mtu = mtu; + cmd.u.mtu.mtu = (u32)mtu; ret = ena_com_execute_admin_command(admin_queue, (struct ena_admin_aq_entry *)&cmd, @@ -2665,7 +2665,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena_dev) return ret; } - cmd.control_buffer.length = (1ULL << rss->tbl_log_size) * + cmd.control_buffer.length = (u32)(1ULL << rss->tbl_log_size) * sizeof(struct ena_admin_rss_ind_table_entry); ret = ena_com_execute_admin_command(admin_queue, @@ -2687,7 +2687,7 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena_dev, u32 *ind_tbl) u32 tbl_size; int i, rc; - tbl_size = (1ULL << rss->tbl_log_size) * + tbl_size = (u32)(1ULL << rss->tbl_log_size) * sizeof(struct ena_admin_rss_ind_table_entry); rc = ena_com_get_feature_ex(ena_dev, &get_resp, -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-06-10 14:04:58.691812350 +0200 +++ 0013-net-ena-base-fix-type-conversions-by-explicit-castin.patch 2021-06-10 14:04:58.026024347 +0200 @@ -1 +1 @@ -From 83e8d5378d3f2eef749d47bb1145c29cc797a277 Mon Sep 17 00:00:00 2001 +From 0731d405e92051ddb5f7c1a11c260efdaf4f69e7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 83e8d5378d3f2eef749d47bb1145c29cc797a277 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 9dc9f280c4..0cdeb1a2d9 100644 +index f8e8f448e3..50b39b88ba 100644 @@ -25,2 +26,2 @@ -@@ -1382,7 +1382,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue, - "Failed to submit command [%ld]\n", +@@ -1340,7 +1340,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue, + ena_trc_err("Failed to submit command [%ld]\n", @@ -34 +35 @@ -@@ -1602,7 +1602,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) +@@ -1559,7 +1559,7 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_dev, u32 groups_flag) @@ -42,2 +43,2 @@ - ena_trc_err(ena_dev, "Reg read timeout occurred\n"); -@@ -2280,7 +2280,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu) + ena_trc_err("Reg read timeout occurred\n"); +@@ -2263,7 +2263,7 @@ int ena_com_set_dev_mtu(struct ena_com_dev *ena_dev, int mtu) @@ -52 +53 @@ -@@ -2691,7 +2691,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena_dev) +@@ -2665,7 +2665,7 @@ int ena_com_indirect_table_set(struct ena_com_dev *ena_dev) @@ -61 +62 @@ -@@ -2713,7 +2713,7 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena_dev, u32 *ind_tbl) +@@ -2687,7 +2687,7 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena_dev, u32 *ind_tbl)