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 ED24441EB5; Thu, 16 Mar 2023 22:30:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E657242FA8; Thu, 16 Mar 2023 22:29:45 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3299A42DB3 for ; Thu, 16 Mar 2023 22:29:39 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32GFtBbd005959 for ; Thu, 16 Mar 2023 14:29:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=OWiimkT2SdltIPNR7G3npw9NlyfZSBQc4wANrv4doW4=; b=WHwLzXFZYG52ONtarBnDXv5nqsNeabs5fM5LjiqyKL57OjH7MCEjdUv98r4UILQaKG7A cqx39SLhFE2gEWzKDSQVb4Lm54KyjqSTZUll1uxK6CCf0zSikvPLQtdd9v22fqAyLxWq gmxOpI+fTij+TuLdLMlNrU6TdHlcKmNKsV/rxSVPlpTMZGPr6CHI7D8W66hhpmo4LKGA 9ABvsjW/GAM/3s2fhrQm4T5OLPE0n5V7bKx5SSAS9LAA68pB07ARPs00bkUztUv5WIB/ fR9nm2DVu4Jnc3RN0f+60LQW/M3uP0ef3gQvAzpyBS5eGQBFz5O2ukbvanuQHwhTlKix Dw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3pbxq2ucrk-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 Mar 2023 14:29:38 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 16 Mar 2023 14:29:35 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 16 Mar 2023 14:29:35 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id C59433F7081; Thu, 16 Mar 2023 14:29:35 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Prince Takkar CC: , , , Subject: [PATCH v3 4/8] ml/cnxk: remove logically dead code Date: Thu, 16 Mar 2023 14:29:00 -0700 Message-ID: <20230316212904.9318-5-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230316212904.9318-1-syalavarthi@marvell.com> References: <20230315135427.11489-1-syalavarthi@marvell.com> <20230316212904.9318-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: PyjrKArGOuvjvXGq_0RQetNowK2oHNYq X-Proofpoint-ORIG-GUID: PyjrKArGOuvjvXGq_0RQetNowK2oHNYq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_14,2023-03-16_02,2023-02-09_01 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 Remove logically dead code. Issue reported by coverity scan. Coverity issue: 383664 Fixes: da3325131d71 ("ml/cnxk: find OCM mask and page slots for a model") Signed-off-by: Srikanth Yalavarthi --- drivers/ml/cnxk/cn10k_ml_ocm.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/ml/cnxk/cn10k_ml_ocm.c b/drivers/ml/cnxk/cn10k_ml_ocm.c index b9211b50a8..2367f40a1d 100644 --- a/drivers/ml/cnxk/cn10k_ml_ocm.c +++ b/drivers/ml/cnxk/cn10k_ml_ocm.c @@ -224,7 +224,6 @@ cn10k_ml_ocm_tilemask_find(struct rte_ml_dev *dev, uint8_t num_tiles, uint16_t w uint16_t scratch_page_start; int used_last_wb_page_max; uint16_t scratch_page_end; - uint8_t search_start_tile; uint8_t search_end_tile; uint8_t *local_ocm_mask; int wb_page_start_curr; @@ -235,14 +234,13 @@ cn10k_ml_ocm_tilemask_find(struct rte_ml_dev *dev, uint8_t num_tiles, uint16_t w uint16_t word_id; uint8_t tile_idx; int max_slot_sz; - int start_tile; int page_id; mldev = dev->data->dev_private; ocm = &mldev->ocm; if (num_tiles > ML_CN10K_OCM_NUMTILES) { - plt_err("Invalid num_tiles = %u (> ML_CN10K_OCM_NUMTILES)", num_tiles); + plt_err("Invalid num_tiles = %u (> %u)", num_tiles, ML_CN10K_OCM_NUMTILES); return -1; } @@ -250,23 +248,11 @@ cn10k_ml_ocm_tilemask_find(struct rte_ml_dev *dev, uint8_t num_tiles, uint16_t w wb_page_start = -1; used_scratch_pages_max = 0; used_last_wb_page_max = -1; - start_tile = -1; max_slot_sz_curr = 0; max_slot_sz = 0; tile_idx = 0; - - if ((start_tile != -1) && (start_tile % num_tiles != 0)) { - plt_err("Invalid start_tile, %d", start_tile); - return -1; - } - - if (start_tile < 0) { - search_start_tile = 0; - search_end_tile = ocm->num_tiles - num_tiles; - } else { - search_start_tile = start_tile; - search_end_tile = start_tile; - } + tile_start = 0; + search_end_tile = ocm->num_tiles - num_tiles; /* allocate for local ocm mask */ local_ocm_mask = rte_zmalloc("local_ocm_mask", mldev->ocm.mask_words, RTE_CACHE_LINE_SIZE); @@ -275,7 +261,6 @@ cn10k_ml_ocm_tilemask_find(struct rte_ml_dev *dev, uint8_t num_tiles, uint16_t w return -1; } - tile_start = search_start_tile; start_search: used_scratch_pages_max = 0; used_last_wb_page_max = -1; -- 2.17.1