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 9B60FA0524; Thu, 6 May 2021 16:26:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C13A41128; Thu, 6 May 2021 16:25:51 +0200 (CEST) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mails.dpdk.org (Postfix) with ESMTP id 9C53F4111D for ; Thu, 6 May 2021 16:25:49 +0200 (CEST) Received: by mail-lf1-f51.google.com with SMTP id h4so8125237lfv.0 for ; Thu, 06 May 2021 07:25:49 -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=2BdPDoLJORRt243MxZJPI0gvo+5S3HZcl0Ng69/Ukg0=; b=XVf/Qi3FLHyxgxx6kjopiy46eX9ATCBf8bpk0qFsu77eomiF+7ead4zaJjphlB5Y2/ gSe90PXjqNhylacMI3hfKBC9Tz9m+MlrQ8772r9nTqMI+Ykd0B+8822d/2MQZC6dweYA G/t3JONGiExsGn+4UNqUBeWKNa4kCQAifrzkuTsMHnqKIxtAfW7lgoE7z9fuwzkq9PmS vxfVqJt6xfbkJ0t022DAf3rxNZEyZhX4XA+09hUA5lhmYdMSTowSCZAUh9k6RcOtBj1X JNann4H6/rRqi2FPHJyYl7bEt54/VLKHOfh7N4nZlLGxmZXCIK7QD43WKSnEmbIJ21U0 Arvg== 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=2BdPDoLJORRt243MxZJPI0gvo+5S3HZcl0Ng69/Ukg0=; b=K4sV4dHjvsZ5N799CpPMOdYh7I4pvMJAVdrf9Td/qR+y0bSewnTLpPGWrdbGSFyfjd CpVeK3vwJdp35DPGgQ9MAKdcf/Oi9bVUku9QzAAb+NrvL4LAJzHS3dsT3t4LCay9bY0Q ohiAJZ0e3rq96cj4PTdBefsC9364Kw88dYqMC5bV7YFtPnUtV+zFxWxJolY4lhInclJb CwbjnXkH+n/KxLAKDzT59PuukZLAcicOqp5mRq1Jf//GOB3sLri4GXkqVT9Hclx/bmWu 9JEeGJHiN4rdcURR1ovHQ4CUv9Pyg4v3i/iNi5npmWJhC1OyJjzHwX27fiHVhf48ICKU NuAA== X-Gm-Message-State: AOAM533SuWQGGEk6RwCWA1Nd7KPzLi+R6/0zORphUpoxoiBkbZ+RxGch dqAY6SICsly58brzwtqTKAqVSfYvT+TJVVOt X-Google-Smtp-Source: ABdhPJw0PZIHjYwDkx63hzBjOP1W80jEq7wPoqgjQJIlWaGMcGE37W+BRBVAAGZsll8Tq0uOyF0FEA== X-Received: by 2002:a19:c712:: with SMTP id x18mr3060424lff.589.1620311148881; Thu, 06 May 2021 07:25:48 -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 b40sm892908ljr.101.2021.05.06.07.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 07:25:48 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Michal Krawczyk Date: Thu, 6 May 2021 16:25:09 +0200 Message-Id: <20210506142526.28245-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210506142526.28245-1-mk@semihalf.com> References: <20210505073348.6394-1-mk@semihalf.com> <20210506142526.28245-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 05/22] net/ena/base: fix issues from the static code scan 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 Sender: "dev" 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 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