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 A95FAA0546; Fri, 30 Apr 2021 14:58:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D8F8410F6; Fri, 30 Apr 2021 14:57:46 +0200 (CEST) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id EE29641133 for ; Fri, 30 Apr 2021 14:57:41 +0200 (CEST) Received: by mail-wm1-f53.google.com with SMTP id n84so10619024wma.0 for ; Fri, 30 Apr 2021 05:57:41 -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=UOSCWjMqko+bQ/rQ/0c6lW+IxfAiQ1trxpCHkd2PtcGwOKgQvjCOqO50wFwf5Us4br 7eLnfkG7TyvAdnxZ0THdwrqSNZ2ztoo3Y5DBKpDBFuOKQFbIqDaKfrUBvLd2kbTRNka8 ms4OnKrGT8lSaQcH5XmWPFdkHivz18oTsuqmKm+m7qnnTZLhD7zqZwyNLR7YYvirE42H OCazsoq4QgFnCuTImxltmk+eX6Hw0kr+deiXoX5LPl8d1dQZnSqcaFSmIXURVrmUuVrF 2RsIhAzRbo3fDnQSzS613wI5njWOJwyhi5DFpWiUGOLme9iEErO/00pFBeVEUmtuSBRx sM+A== 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=m4JJZDSkRqCIDwoQKqdnjF/XgV0OcaNietMMoFicr3AXlTIDOr4i/jasRsdhS5JYC0 oPTbFxWaOhqv80bW9WFprIIeRiIC4ODf2d3o5yF+3YQzdprt4XOmVJvO2cDVYnhqwfTG LiTIPShZSG9Imd0CkQuVPw3Vmc31Hk2I5vSsTM1ABH6notYneh0rFMdBFnuU59mKs0XO bvmWzqBZu4P0sxIbeMtz0x3In/N8qMlePIP93G5OO/urMueYjQP8bIKxqA64QZuDLbNs kFsdaI82lz7MZQxaYryqHUg9jJXSaGp3yyaO3AdKWB6xFmJ3uKJAYv4cEX1Xt9+Wnl8q 45Dg== X-Gm-Message-State: AOAM532+xc8lV8hElomU8aSbJo6IFDlqRNr9NJ8Rrn628catQ27wA5Xd f91syt4UClwKlTgfDjiFSaR+mHM2/qZU1M6I X-Google-Smtp-Source: ABdhPJyJnj5xExDYJxBxE9sKkTOsgaEAaLY48KOFpgfKIY93cNRN/sA3gbYqrWeTDyHHFUPuIGkUjw== X-Received: by 2002:a05:600c:4fd4:: with SMTP id o20mr16955927wmq.166.1619787461431; Fri, 30 Apr 2021 05:57:41 -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 l13sm13476245wmj.3.2021.04.30.05.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 05:57:40 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazom.com, gtzalik@amazon.com, igorch@amazon.com, mw@semihalf.com, Michal Krawczyk Date: Fri, 30 Apr 2021 14:57:08 +0200 Message-Id: <20210430125725.28796-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430125725.28796-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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