DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] mldev: fix identical code in conditional branches
@ 2023-03-11 14:56 Srikanth Yalavarthi
  2023-03-13 11:01 ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Srikanth Yalavarthi @ 2023-03-11 14:56 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mldev: fix identical code in conditional branches
  2023-03-11 14:56 [PATCH] mldev: fix identical code in conditional branches Srikanth Yalavarthi
@ 2023-03-13 11:01 ` David Marchand
  2023-03-15  9:48   ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2023-03-13 11:01 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara

On Sat, Mar 11, 2023 at 3:56 PM Srikanth Yalavarthi
<syalavarthi@marvell.com> wrote:
>
> 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>
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mldev: fix identical code in conditional branches
  2023-03-13 11:01 ` David Marchand
@ 2023-03-15  9:48   ` David Marchand
  0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2023-03-15  9:48 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara

On Mon, Mar 13, 2023 at 12:01 PM David Marchand
<david.marchand@redhat.com> wrote:
> On Sat, Mar 11, 2023 at 3:56 PM Srikanth Yalavarthi
> <syalavarthi@marvell.com> wrote:
> >
> > 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>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.

-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-15  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 14:56 [PATCH] mldev: fix identical code in conditional branches Srikanth Yalavarthi
2023-03-13 11:01 ` David Marchand
2023-03-15  9:48   ` David Marchand

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).