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 0C1DDA0C41 for ; Tue, 11 May 2021 08:46:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BEBE4111A; Tue, 11 May 2021 08:46:23 +0200 (CEST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id 2879941110 for ; Tue, 11 May 2021 08:46:18 +0200 (CEST) Received: by mail-lf1-f48.google.com with SMTP id r5so9859070lfr.5 for ; Mon, 10 May 2021 23:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V0IC5ZMJ2JJoN/i34MEt6/PQbjXRCX6bleKIA9W5I2s=; b=LogTIju+q11WJ8Nyf8Ni3iADqesdtxN14iqlVZ1tXHbxO/7c2WkhplxJZz7uCV7tZ5 XH6txX8sJGojjgElaFUoHLSi3KKYvty7h+WOSP3Cg5w5nKxxrJ6gIKo9NXgCtJ8HfcZE z4N+ve3bWEjAFUIzkE2WfmDrAF4xpUPoTYrzLpBYXpNN53iPNOHz2xVe8RfTqoUrHpXG 4aVGIFnRvg4QFzdMkBT7yxhfqbpJGQ8IBUDpQfqSsV+gQGwNCnper558YuQiRarblw/A twdky2Dpdw0/F4LOk6R0UvlXlpL8f4XXUbovqyWU5fVLtFoRs6AG0Dx7JS69InZlH+Iq owwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V0IC5ZMJ2JJoN/i34MEt6/PQbjXRCX6bleKIA9W5I2s=; b=gbEJNE+qK/bxUWX4dS8aB+QwWP4paeLVvkGEfq2jnPAQCL0nBP161DcwSyvAWFmwS0 OETRs3p9ALIRcEKQHMWywJel8Ho1vA9LmpUEbb5mIsxDmH16IhyA1BP7J2DzqzGuYOVc 27fhlYuTj/340DOP6joMEK+1E25Dvu9OX5aVCMNrCd+GuxuN26lgjIdaunQ6T1CwVZb/ qVbFqm8teMogTjwC4Q4Ka7Pj9HtapA74LbDFfpgmquLR/lO+FHvkNH84N/HgiSPYCp7r z7KEaDEtScOlor7vy6qcaEwYud+0CrF7QvAtKXdmavRHI/CUlEU2FYWinuGiCAmIU7iZ D8pQ== X-Gm-Message-State: AOAM533Up9Lw/MCuuvpmLpTiyjv10d5zZB4Qkcq9BF2qQ2UtUfHCVNDt EWHqfVS74CNd4eeuBgLSdW62tQ== X-Google-Smtp-Source: ABdhPJwybDMccuJidtUZz1Pt1dEIHh64Y0e+DPtOOFXwezr8Eo0sN4O9bVjRJ5UuPpmlgWGFoOK6vg== X-Received: by 2002:a19:7604:: with SMTP id c4mr18376535lff.627.1620715577847; Mon, 10 May 2021 23:46:17 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl. [89.79.189.199]) by smtp.gmail.com with ESMTPSA id v20sm2496776lfd.92.2021.05.10.23.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 23:46:17 -0700 (PDT) From: Michal Krawczyk To: ferruh.yigit@intel.com Cc: dev@dpdk.org, ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org Date: Tue, 11 May 2021 08:45:40 +0200 Message-Id: <20210511064554.10656-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511064554.10656-1-mk@semihalf.com> References: <87e65a42-4ae5-1a81-8f8e-74759fc14999@intel.com> <20210511064554.10656-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v4 05/19] net/ena/base: fix issues from the static code scan 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" 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") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Guy Tzalik --- v4: * Add stable dpdk as cc. 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 9dc9f280c4..0cdeb1a2d9 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -1382,7 +1382,7 @@ int ena_com_execute_admin_command(struct ena_com_admin_queue *admin_queue, "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); @@ -1602,7 +1602,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(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) 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, @@ -2691,7 +2691,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, @@ -2713,7 +2713,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.25.1