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 57E2141E73; Sat, 11 Mar 2023 15:56:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9121410F9; Sat, 11 Mar 2023 15:56:12 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 832F640FAE for ; Sat, 11 Mar 2023 15:56:11 +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 32BD2c1C012965 for ; Sat, 11 Mar 2023 06:56:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=wZA1BotWD9rDv+CHXn0S0KhvI9Dx6HFs7S+BRA1AfUY=; b=TZqLFQVaZ+sx5s4jzexLXNkk52DR6/pwxT/M9EdYORuNLf4U5XyyJYbVZRz1MJtWMSbr 5qcsD5puxIxNruel0qAS+C1SDlBquvIws/FuoRISUAhH9HTaMXmaOS1ebH3pJBcwTx5M /HdsIrFW7cKZ22fZXDexENtF8czyZnU3jOb0RXmE79b3ukZxOv1J2fURN+EmDsphcGs6 s3uZAzez1lN3KVrkHW+xPVhycXTOjcZd6lSfv0d65XrPpJZwY7LhjCTw6oiq2TxNSam3 u3JA7UBs7UIgnWCV83N2/ml3yZ/nHrHFcUplt8wrXWLcNyIqepocCUcQzvRS0+M46u2z Dw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3p8qvv8ebe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 11 Mar 2023 06:56:10 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Sat, 11 Mar 2023 06:56:08 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Sat, 11 Mar 2023 06:56:08 -0800 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 4DAEF3F7070; Sat, 11 Mar 2023 06:56:08 -0800 (PST) From: Srikanth Yalavarthi To: Srikanth Yalavarthi CC: , Subject: [PATCH] mldev: fix identical code in conditional branches Date: Sat, 11 Mar 2023 06:56:06 -0800 Message-ID: <20230311145606.5523-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: ijkBU46Uxv15wZa0H2rUvT95pIgurZXd X-Proofpoint-GUID: ijkBU46Uxv15wZa0H2rUvT95pIgurZXd 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-11_04,2023-03-10_01,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 Fix identical code in different conditional branches in float32 to float16 conversion function. Issue reported in coverity scan. Coverity issue: 383651 Fixes: 9637de38a2e3 ("mldev: add scalar type conversion") Signed-off-by: Srikanth Yalavarthi --- lib/mldev/mldev_utils_scalar.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/mldev/mldev_utils_scalar.c b/lib/mldev/mldev_utils_scalar.c index 40320ed3ef..00c3aa60bf 100644 --- a/lib/mldev/mldev_utils_scalar.c +++ b/lib/mldev/mldev_utils_scalar.c @@ -336,10 +336,7 @@ __float32_to_float16_scalar_rtn(float x) switch (f32_e) { case (0): /* float32: zero or subnormal number */ f16_e = 0; - if (f32_m == 0) /* zero */ - f16_m = 0; - else /* subnormal number, convert to zero */ - f16_m = 0; + f16_m = 0; /* convert to zero */ break; case (FP32_MASK_E >> FP32_LSB_E): /* float32: infinity or nan */ f16_e = FP16_MASK_E >> FP16_LSB_E; -- 2.17.1