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 <syalavar...@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

Reply via email to