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 A27DDA0524; Wed, 5 May 2021 09:34:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0038341121; Wed, 5 May 2021 09:34:08 +0200 (CEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 42B104110B for ; Wed, 5 May 2021 09:34:06 +0200 (CEST) Received: by mail-wm1-f42.google.com with SMTP id o127so781575wmo.4 for ; Wed, 05 May 2021 00:34:06 -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=K+qgKPbMpKRANXMxM52eEOW9IVyosb3NmUxzG1yn7TJtOCHykeUppJAe63Kw/9xsR1 aueSguMKgTkRq+ESy5k5VX2WjLfWBX2vlQ3Xl7s3T2U0XpSXiijaT0gxIF7vvHcjuvv4 FPevOmj+KM0crtB1d2TMJm7Gtj78y3w/0z47zhlA6KZV2MYmF2TTa30K5iJKTND7ULBP Z7dGTKQPO5/N6LeKZyw4Pu+jBt7XbPCPAjcvQ+HgksCrhO+lvpgke3lYsbNUQqxljb2f FBaQDHI32AvZ19drPXgCksnOpT/QYsr+WsYbyprSLzI9kx/EFgZMJIJLMdKbyGwSo87O Yxyw== 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=oiGWLWszWFVfStRE51FeBqqXcv0ErleN+Qy45I/dyjtOU6uHSOesVGGBkK/hhwhiJV JKDcrMBP5VMICsQCpSAFy4avt9+v0Bmnk3YqVXVHZDpST04wlxwqJidjfZDHrUS0W5KI 6cKpitm54xHQ5Hi9JJxk/YnA/Yatc9+6e4tAf0ATJ/OI8VilHo6qgbBwOQlYYIFJqo+4 jm8n4r+vQPl5AseiRs+MkYEmq61LGCKsZnrvm3CdCp9N7QAFSAXPHNExBbGI6sZPYdly flkugvI5Rfe/Cf062iuKMG+lLD1nm6pR19A4+KkTm741LfID/pAMCu13FluzCplJTLhO lVNw== X-Gm-Message-State: AOAM530YKXYRNJJeeUIIg6jWxb9BghmMkez0XdUFSkSL7kp4kSWZ1rPI lW7YNbREmmLNYsff8yXxOGXh0uLWaDHoBuKF X-Google-Smtp-Source: ABdhPJwDj98JPXiA6PPQJb/PQg21OfS0KMCrDOj6SXogxx3IQ7z+2GutiL+o/SipuRKlJnozq8R2qQ== X-Received: by 2002:a1c:9817:: with SMTP id a23mr19182210wme.171.1620200045708; Wed, 05 May 2021 00:34:05 -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 t17sm4679856wmq.12.2021.05.05.00.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 00:34:05 -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: Wed, 5 May 2021 09:33:31 +0200 Message-Id: <20210505073348.6394-6-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505073348.6394-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> <20210505073348.6394-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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