From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>
Subject: [PATCH] mldev: fix identical code in conditional branches
Date: Sat, 11 Mar 2023 06:56:06 -0800 [thread overview]
Message-ID: <20230311145606.5523-1-syalavarthi@marvell.com> (raw)
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 <syalavarthi@marvell.com>
---
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
next reply other threads:[~2023-03-11 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-11 14:56 Srikanth Yalavarthi [this message]
2023-03-13 11:01 ` David Marchand
2023-03-15 9:48 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230311145606.5523-1-syalavarthi@marvell.com \
--to=syalavarthi@marvell.com \
--cc=dev@dpdk.org \
--cc=sshankarnara@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).